-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Preferences are cleared in debug mode android it works fine in release mode #28654
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
Comments
@taddisateesh I checked this issue in a simple way using the default .NET MAUI template, and it works fine in both debug and release modes. Can you share a reproduction sample to replicate the issue? |
@sheiksyedm I have attached sample project here. Please test this on android device/emulator in debug mode |
@taddisateesh Can you share the device info along with the Android version? I tested this issue on a Google Pixel 6a (Android 14, API 34), and it was not reproducible in the latest 9.0.50 SR5. |
@sheiksyedm Could you please verify using vs code for mac ? |
@taddisateesh yes, I verified this using VS Code for mac only(Emulator Pixel 7, API 35). Please check the video for your reference. Screen.Recording.2025-03-28.at.7.59.00.PM.mov |
Description
public string LanguageCode
{
get => Preferences.Default.Get(nameof(LanguageCode), string.Empty);
set => Preferences.Default.Set(nameof(LanguageCode), value);
}
in the above code Preferences getting cleared on next launch.
FYI: This can be reproducable in debug mode. Release mode it works fine.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
9.0.40 SR4
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
8.0.71 SR7.1
Affected platforms
Android
Affected platform versions
Android
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: