0

I have an app that I uses shared preferences as data storage.

I released it in debug mode on my phone and used the app for a few months.

Suddenly, I need to make an update to the app. However, I am shocked to see that The application could not be installed: INSTALL_FAILED_UPDATE_INCOMPATIBLE

They say I need to uninstall the app first, but I can't because I do not want to lose the data saved in the shared preferences!

I am confused why I see this message because I am using the same computer I used to make the app. So why the debug.keystore changed??

.android % ls -hlat
total 32
drwxr-x---+ 44 samuel  staff   1.4K Dec  8 13:17 ..
-rw-r--r--   1 samuel  staff   2.5K Dec  8 12:58 debug.keystore
drwxr-xr-x   9 samuel  staff   288B Dec  8 12:58 .
-rw-r--r--   1 samuel  staff     0B Dec  8 12:58 debug.keystore.lock
-rw-r--r--   1 samuel  staff   219B Nov  3 11:03 analytics.settings
drwxr-xr-x  36 samuel  staff   1.1K Oct 10 23:31 cache
-rw-------   1 samuel  staff   1.7K Sep  5 21:32 adbkey
-rw-r--r--   1 samuel  staff   734B Sep  5 21:32 adbkey.pub
drwxr-xr-x   4 samuel  staff   128B Sep  5 21:23 avd
samuel@Tolotras-MacBook-Air .android % cat debug.keystore

What are my options to recover the data and update the app ?

TSR
  • 17,242
  • 27
  • 93
  • 197

1 Answers1

0

Not sure why the Android studio updated my debug.keystore but I have see some people saying that it can expire too (https://stackoverflow.com/a/52367867/6727914)

Option 1: I can back it using adb

https://stackoverflow.com/questions/23635644/how-can-i-view-the-shared-preferences-file-using-android-studio#:~:text=From%20Android%20Studio%20%2C%20start%20Android,that%20directly%20from%20Android%20Studio.

TSR
  • 17,242
  • 27
  • 93
  • 197