storesafe / cordova-sqlite-storage

A Cordova/PhoneGap plugin to open and use sqlite databases on Android, iOS and Windows with HTML5/Web SQL API
Other
2.14k stars 713 forks source link

After uninstall and install the app the DB is filled with old data #957

Open harisrnd opened 3 years ago

harisrnd commented 3 years ago

Android: 10.1 android sdk - build tools: 30.0.2 cordova-android: 9.0.0 Cordova CLI: 10.0.0 cordova-sqlite-storage 5.1.0 var dbObj = window.sqlitePlugin.openDatabase({"name": , location: 'default'}); If I uninstall the app and install it again, the database has data of a previous version. If I "clear data" from app settings the database is empty. But when I uninstall and install again, the old data appears again(I don't know where from).

I do not know if this is a SQLite bug or sth else, I just thought I had to report this.

TDola commented 3 years ago

It's Android trying to load a backup. A very frustrating feature.

laurentperez commented 3 years ago

Hello. Same bug here. Is there a trick to refresh the previous SQLite to avoid the backup ? Like creating a version based database

ferreria23 commented 2 years ago

Any solution about this?

pabloaotero commented 2 years ago

This works for me.

Add android:allowBackup="false" into config.xml:

       <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
        <application android:usesCleartextTraffic="true" />
            <application android:allowBackup="false" />
       </edit-config>
brodybits commented 2 years ago

I hope to get this documented in the future, thanks.