5

I'm developping an app with targetSdkVersion 23. I would like to use auto-backup service from Google, but it does not work. I'm using example found on this page

I have configured my AndroidManifest.xml with

android:fullBackupContent="@xml/akbackupscheme"

and akbackupscheme.xml :

<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
    <include domain="sharedpref" path="mysharedpref"/>
    <include domain="database" path="mydatabase.db"/>
</full-backup-content>

I'm using adb to test it and these are traces I got :

./adb shell bmgr fullbackup com.*****

Performing full transport backup

./adb shell bmgr restore com.*****

Unable to restore package com.*****

done

Here are some traces :

11-25 17:05:47.977 1419-1419/? D/AndroidRuntime: Calling main entry com.android.commands.bmgr.Bmgr

11-25 17:05:47.982 603-1101/? W/BackupManagerService: Requested unavailable transport: com.google.android.gms/.backup.BackupTransportService

11-25 17:05:47.982 603-1101/? W/BackupManagerService: Transport not present; full data backup not performed

11-25 17:05:47.982 603-1101/? I/BackupManagerService: Full backup not currently possible -- key/value backup not yet run?

11-25 17:05:47.982 603-1101/? D/BackupManagerService: Done with full transport backup.

Community
  • 1
  • 1
  • You aren't alone: http://stackoverflow.com/questions/33743941/how-do-you-test-the-android-6-0-full-backup-behavior – CommonsWare Nov 25 '15 at 15:52
  • I just added in Android preference a gmail account and now i get that : 11-25 18:15:21.858 1490-1516/? I/GmsBackupTransport: Attempt to do full backup on com.***** 11-25 18:15:21.859 1490-1516/? V/GmsBackupTransport: Rejecting full data backup. user has not seen up to date legal text – Tonio Marco Nov 25 '15 at 17:23
  • Yeah, that's a messy problem. I found a solution here on Stack Overflow somewhere (search on "user has not seen up to date legal text"). IIRC, I wound up having to remove my Google account from the device, re-apply it, and then do something else (toggle on and off backups?) to get this "legal text" to appear and get past this message. – CommonsWare Nov 25 '15 at 17:26
  • @CommonsWare When you removed your Google Account from the device, did you lose data from apps or have to re-install anything? What process did you use to remove your Account? – rythos42 Apr 05 '16 at 18:29
  • 1
    "When you removed your Google Account from the device, did you lose data from apps or have to re-install anything?" -- well, it was a test device, so I don't know what I would have lost. I would expect that, at most, it might have affected some of Google's apps. "What process did you use to remove your Account?" -- IIRC, I just removed it via Settings > Accounts > Google > "Remove account". – CommonsWare Apr 05 '16 at 18:32
  • This did fix my issue, and my app is now being backed up apparently. My test device is also my personal device, so removing the account was a little scary, but I have a NAndroid backup so...anyway, I cleared Google Play Services, removed my Google Account as above, added it back in, had a few panic moments, rebooted and now it is working. Thanks! – rythos42 Apr 05 '16 at 21:01
  • I get a 'PFTBT: Transport rejected backup' :-/ – Someone Somewhere Jul 09 '16 at 13:22

1 Answers1

0

I had this problem too. Removing and then re-adding my Google account resolved it. I selected 'back up this device to google drive' when adding the account back but I'm not sure if that actually had any effect.

Once the account was added back I noticed a lot of backup-related logcat spam and the next time I requested a full backup it worked.

D/BackupManagerService: fullTransportBackup()
I/PFTBT: Requested package com.example.mh.backuptest not found; ignoring
I/PFTBT: Full backup completed with status: 0
I/BackupManagerService: Full data backup pass finished.
D/BackupManagerService: Done with full transport backup.
Tom
  • 6,946
  • 2
  • 47
  • 63