You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New MAUI app throws FileNotFoundException when launched on Android 14.
The issue has been reported before at #7002 and #10821.
Clearing the .vs folder or adding <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk> as suggested by the previous issues seems to have no effect.
I reproduced in Visual Studio Preview 17.13.77.2683 and Visual Studio 17.10.341.11210.
Steps to Reproduce
Create a MAUI project
Enable all Common Language Runtime Exceptions
Run app against Android device. Android device must have different system language than English (United States) such as Dansk (Danmark)
Expected outcome: App launches with debugger attached without any exceptions
Actual outcome: App launches with debugger, but will break on InitializeComponent() in App.xaml.cs. After continuing past 5 exceptions the App runs as expected.
Set Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture before InitializeComponent runs. E.g. in CreateMauiApp().
If setting culture to invariant is not a viable option it is possible to get around the exception by ensuring *.resources.dll exists in the build output. One horrible way of achieving this is by:
Create two class libraries in the solution called System.Private.CoreLib and System.Private.Xml
In each class library add .resx files for the cultures you need (da-DK in our case)
[monodroid-assembly] open_from_bundles: failed to load bundled assembly da-DK/System.Private.CoreLib.resources.dll
[monodroid-assembly] open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
[monodroid-assembly] open_from_update_dir: assembly file DOES NOT EXIST
[monodroid-assembly] open_from_bundles: failed to load bundled assembly da-DK/System.Private.CoreLib.resources.dll
[monodroid-assembly] open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
[monodroid-assembly] open_from_bundles: failed to load bundled assembly da-DK/System.Private.CoreLib.resources.dll
[monodroid-assembly] open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
[monodroid-assembly] open_from_update_dir: assembly file DOES NOT EXIST
[monodroid-assembly] open_from_bundles: failed to load bundled assembly da-DK/System.Private.CoreLib.resources.dll
[monodroid-assembly] open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
**System.IO.FileNotFoundException:**''
...........
[monodroid-assembly] open_from_bundles: failed to load bundled assembly da-DK/System.Private.Xml.resources.dll
[monodroid-assembly] open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
[monodroid-assembly] open_from_update_dir: assembly file DOES NOT EXIST
[monodroid-assembly] open_from_bundles: failed to load bundled assembly da-DK/System.Private.Xml.resources.dll
[monodroid-assembly] open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
**System.IO.FileNotFoundException:**''
...........
The text was updated successfully, but these errors were encountered:
Description
New MAUI app throws FileNotFoundException when launched on Android 14.
The issue has been reported before at #7002 and #10821.
Clearing the .
vs folder
or adding<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
as suggested by the previous issues seems to have no effect.I reproduced in Visual Studio Preview 17.13.77.2683 and Visual Studio 17.10.341.11210.
Steps to Reproduce
Expected outcome: App launches with debugger attached without any exceptions
Actual outcome: App launches with debugger, but will break on InitializeComponent() in App.xaml.cs. After continuing past 5 exceptions the App runs as expected.
Link to public reproduction project repository
https://github.com/icefire1/ResourceFileNotFound9
Version with bug
9.0.0-rc.2.24503.2
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 14
Did you find any workaround?
Set
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture
before InitializeComponent runs. E.g. in CreateMauiApp().If setting culture to invariant is not a viable option it is possible to get around the exception by ensuring *.resources.dll exists in the build output. One horrible way of achieving this is by:
Relevant log output
Full Debug output can be seen in the repro repo ResourceFileNotFound9/ResourceFileNotFound9.Droid/debug-output.txt
The text was updated successfully, but these errors were encountered: