2

I have developed an application with Flutter and Sqlite and I can't get the android auto backup working. I have explicitly put android:allowBackup="true" in the AndroidManifest.xml. The very first time I executed the command:

adb shell bmgr backupnow

I got:

Running incremental backup for 1 requested packages. Package @pm@ with result: Success Package with result: Size quota exceeded Backup finished with result: Success

After that time I got:

Running incremental backup for 1 requested packages. Package @pm@ with result: Success Package with result: Transport rejected package because it wasn't able to process it at the time Backup finished with result: Success

I can't understand why I have the error "Size quota exceeded": the sqlite database size is far below 25 mb! I have tried on different devices, with no success.

1 Answers1

1

Regarding being over 25MB, are there any flutter temporary files used to speed up debugging installed in the app's private folders? If you have a debuggable app installed, you should be able to query the internal storage of the app to see what's stored there by calling:

adb shell run-as <APP_PACKAGENAME> ls -al 

That way you can see what is in the files and databases folders it's trying to backup. If there are files you want to exclude, or only a few you want to include in the backup you can specify custom rules by adding:

android:fullBackupContent="@xml/backup_rules"

  

along side the android:allowBackup="true" setting (see https://developer.android.com/guide/topics/data/autobackup for more details on the contents of that xml file).

It might also be worth logging into Google Backups to see the backups associated with the Google account you're logged in with. From there you can see how many apps, and how much setting data is stored, and delete stale backups.

You may also delete a device's backup by toggling off and on again the Backup To Google Drive setting. That way you'd know you're starting a test from "fresh".

After trying various combinations of backup commands from other "solutions" I found MH's answer here: How Do You Test the Android 6.0 Full-Backup Behavior?

By deleting the test device's backup, then following the steps in that link that got me past the Quota and "Transport rejected package because it wasn't able to process it at the time" errors I was seeing, and get an actual backup response like:

Running incremental backup for 1 requested packages.
  Package @pm@ with result: Success
  Package com.example.myapp with progress: 512/66048
  Package com.example.myapp with progress: 2560/66048
  Package com.example.myapp with progress: 10752/66048
  Package com.example.myapp with progress: 18944/66048
  Package com.example.myapp with progress: 27136/66048
  Package com.example.myapp with progress: 35328/66048
  Package com.example.myapp with progress: 43520/66048
  Package com.example.myapp with progress: 51712/66048
  Package com.example.myapp with progress: 59904/66048
  Package com.example.myapp with progress: 68096/66048
  Package com.example.myapp with progress: 68608/66048
  Package com.example.myapp with result: Success
  Backup finished with result: Success

After that, uninstalling and re-installing the app on that test device showed the backed up content correctly restored.

SteveC
  • 1,594
  • 2
  • 14
  • 14