-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[android] MAUI app with localized resources build on Windows crashes with non-default culture #9151
Comments
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger |
Looks like it's somehow not respecting the culture you want:
|
Sorry, that's a mismatch in the issue description and the reported crash log. The |
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 dotnet/runtime#98495. However, inspecting the binlogs from Preview 2 and Preview 5, I noticed that there are no entries for |
/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. |
@matouskozak: was this app built on Windows? If so, it may be fixed by #9315. |
Yes, it was windows-only issue for me and looked related to the other Android crashes related to library loading. Is the fix part of any RC release already so that I can try it out? |
It's going to be part of RC2, it's in the branch here. You could test the fix before the release by getting nuget packages from the |
Sounds like this should be fixed in .NET 9 RC2. Did you get a chance to test on the latest preview? |
Hi @matouskozak. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Sorry, I had problems with my Windows dev machine. I just tried it out and I'm getting no more errors. Thank you for fixing. |
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 #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
The text was updated successfully, but these errors were encountered: