Open matouskozak opened 1 month ago
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.
Looks like it's somehow not respecting the culture you want:
looking for bundled name: 'cs-CZ/AndroidGlobalizationRepro.resources'
Looks like it's somehow not respecting the culture you want:
looking for bundled name: 'cs-CZ/AndroidGlobalizationRepro.resources'
Sorry, that's a mismatch in the issue description and the reported crash log. The cs-CZ
is the desired culture in this case. Updated.
Another question, is this a runtime issue or a xamarin-android one? Reason why I ask is they have a custom way of loading assemblies.
Another question, is this a runtime issue or a xamarin-android one? Reason why I ask is they have a custom way of loading assemblies.
I'm unsure on that. We had a big runtime change related to Globalization shipping after Preview 2 https://github.com/dotnet/runtime/pull/98495.
However, inspecting the binlogs from Preview 2 and Preview 5, I noticed that there are no entries for cs-CZ/AndroidGlobalizationRepro.resources
in the Preview 2 log (the functioning app) whereas Preview 5 (broken app) reports multiple entries. This hints that there might have been changes on upper layer related to how localized resources are handled. @jonathanpeppers do you have any ideas on this?
/cc @grendello maybe there is something going wrong with:
Yeah it does feel more like a dotnet/android issue to me.
@jonathanpeppers @grendello would you like me to transfer the issue to dotnet/android?
@matouskozak yes, please. It does look like an issue with our app build process.
Description
Android MAUI app with localized resources crashes in Release configuration on startup with non-default culture. The app crashes when built on Windows, when built on Mac the app works fine. This failure was originally reported in https://github.com/dotnet/android/issues/9153.
When the app is built in Debug configuration, the app doesn't crash. However, the non-default culture is not respected and localized resources for default culture are used.
Reproduction Steps
MauiProgram.cs
e.g. withSystem.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("cs-CZ");
or by going into device settings and changing language/location manually.-f net9.0-android
) in Release mode (-c Release
)Expected behavior
The app builds and runs without errors, displaying the localized resources for the changed culture.
Actual behavior
The app crashes on startup with:
Regression?
Yes, works with .NET preview 2
Known Workarounds
Use .NET 9 preview 2 or build the app on Mac.
Configuration
Other information
No response