question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

x:Array as resource with key crashes app on device launch

See original GitHub issue

Description

This works in the iOS simulator and on desktop. The goal is to have an array of data I can reuse by key.

<?xml version="1.0" encoding="UTF-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">

    <x:Array Type="{x:Type x:String}" x:Key="CategoriesArray">
        <x:String>Noodles</x:String>
        <x:String>Rice</x:String>
        <x:String>Appetizers</x:String>
        <x:String>Desserts</x:String>
        <x:String>Beverages</x:String>
    </x:Array>

</ResourceDictionary>

This initially was in the Styles.xaml which I split apart for troubleshooting and used merged dictionaries.

That doesn’t work on an iOS device. I get an error about the type converter failing.

The below however does work on the ContentPages:

<BindableLayout.ItemsSource>
    <x:Array Type="{x:Type x:String}" >
        <x:String>Noodles</x:String>
        <x:String>Rice</x:String>
        <x:String>Appetizers</x:String>
        <x:String>Desserts</x:String>
        <x:String>Beverages</x:String>
    </x:Array>
</BindableLayout.ItemsSource>

Steps to Reproduce

Add an array with key to your styles, bind to a BindableLayout, and then run on an iOS device.

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15

Did you find any workaround?

don’t use a resource

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
Eskissimocommented, Feb 11, 2023

Hi,

The issue happens also when we publish Android app with AOT enable.

Regards.

3reactions
Nibbycommented, Feb 7, 2023

I can also attest that this issue is still happening. On a blank MAUI template project, adding x:String entries to the Styles.xaml resource dictionary causes the app to crash when it is deployed to a device (iOS and Android). Interestingly, it only occurs when <MtouchLink> is set to SdkOnly in the csproj file. If it is set to None, the problem goes away.

This is a serious blocker to a project I am working on.

My workload version are as follows:

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
wasm-tools                 7.0.2/7.0.100          SDK 7.0.100        
macos                      13.1.1007/7.0.100      SDK 7.0.100        
maui-maccatalyst           7.0.59/7.0.100         SDK 7.0.100        
maui-ios                   7.0.59/7.0.100         SDK 7.0.100        
maui-android               7.0.59/7.0.100         SDK 7.0.100        
ios                        16.2.1007/7.0.100      SDK 7.0.100        
maccatalyst                16.2.1007/7.0.100      SDK 7.0.100        
maui                       7.0.59/7.0.100         SDK 7.0.100        
android                    33.0.26/7.0.100        SDK 7.0.100   

Hope this issue can be fixed in the near future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does my kernel restarts/dies when displaying or ...
1 Answer 1 ... xr.DataArray.values is a property which returns all of the data as a numpy array. Numpy has no concept of...
Read more >
ChangeLog
Without the patch, the crash fails to start a session with the error message: /var/tmp/ramdump_elf_XXXXXX: ELF header read: No such file or directory...
Read more >
Troubleshooting Reader Connectivity Issues
Press the Windows key and R at the same time. Run dialog opens. Enter devmgmt.msc and click OK button. If prompted, choose Yes....
Read more >
Fix memory problems - Microsoft Edge Development
Use Microsoft Edge DevTools to find memory issues that affect page performance, including memory leaks, memory bloat, and frequent garbage ...
Read more >
Active questions tagged crash - Stack Overflow - RSSing.com
My iOS application is crashing randomly in a remote site due to a CPU usage warning, which is not reported in Crashlytics.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found