I have a version of my app currently in production. I have switched from windows PC to Mac recently.
Now when I release an updated APK from my Mac, the sqlite
database is lost on updating the app. Even the table which I'm not dropping through code for sure, is being dropped. And it didn't even get created when I included a create if not exists...
query.
Should something other than the source code be affecting this (like the underlying android SDK or the JDK)? I never enabled proguard in any of my app releases. FYI, the issue doesn't occur when I use our test server (UAT) urls in the app. It happens only in the production environment. In the UAT environment, everything still works fine on app upgrade. This is what startles me.
Several users are using the existing app and they might need to upgrade anytime. They must be able to upgrade without uninstalling the existing app. What could be the reason for this behaviour?
The issue got resolved for me.
The column name of a table got changed accidentally which I didn't notice. This was causing the problem in the app as the basic credentials of the app were not being saved to the SQLite database. Now I have corrected the column name to its previous name. This fixed the issue. In UAT environment, we had both the APKs with matching column names. That's the reason the issue was occurring only in the production environment.