Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

After upgrading to Android 12, SQLite is not retaining values and Xamarin User Preferences is not retaining values

Open sisaacks opened this issue 3 years ago • 4 comments

Android application type

Classic Xamarin.Android (MonoAndroid12.0, etc.)

Affected platform version

Microsoft Visual Studio Professional 2019 Version 16.11.10

Description

NOTE upon further investigation, it appears that this is happening on IOS as well. I am absolutely baffled as to what is going on

Well I honestly am baffled. I have a version published out in closed testing prior to updating to Android 12. The app works just as it should. As it has for the last two years. After upgrading to Android 12, I have tables that are not retaining values when saving and I the Xamarin Preferences are not retaining values between tabs. Meaning I set a preference in one tab, navigate to the next and Get the Preference....the preference defaults instead of the value I just saved. I am absolutely baffled as to what is going on. I am not sure if its Xamarin or Visual Studio. I have also tried on Visual Studio 2022 and the same issues persist. Curious if anyone else has seen these issues or you all may have a clue of what may have caused this.

Steps to Reproduce

The only thing I can say is upgrade from Android 11 to Android 12 and see if your user preferences are updating between tabs and tables are retaining values. I have a AppSettings Table which is the saved values from the User Prefereces...However....each time I restart the app the user preferences have been cleared.
Xamarin Forms: 5.0.0.2401 Xamarin Essentials: 1.7.2 sqlite-net-pcl: 1.8.116

Did you find any workaround?

No

Relevant log output

No response

sisaacks avatar Apr 12 '22 01:04 sisaacks

Looks like Xamarin Preferences is a part of Xamarin Essentials? Transferring issue to that repository.

jpobst avatar Apr 12 '22 16:04 jpobst

@jpobst I created a sample project and it works as it should. I am absolutely puzzled as to what has happened. I have done a lot of upgrades...Visual Studio, Android 12, Xamarin, Sqlite.....I am guessing a file got messed up somewhere...I just have no idea where or what would cause this

sisaacks avatar Apr 12 '22 16:04 sisaacks

have you found a solution yet, I'm stuck in this problem!!

RamyOscar avatar Aug 17 '22 18:08 RamyOscar

@RamyOscar what versions of Xamarin Forms are you running and what versions of sqlite? I dont recall what the fix was...but its now working. I think it may have been the version of sqlite i was using.

sisaacks avatar Aug 17 '22 18:08 sisaacks