Unable to restore package
I have an old application that I've been updating by adding android backup service. I use a BackupAgent to take the content from a table in my SQLite database and write it to a JSON file and then upload it. I've used http://developer.android.com/guide/topics/data/backup.html as reference when coding this.
It works great on my Nexus 5 which runs Android 6.0 Marshmallow. onBackup is called when it's supposed to and so is onRestore. The problem occurs when I try the application on devices that run Lollipop (and probably devices that are pre-Lollipop).
Unable to restore package com.zecave.petter.zeblocker
Is the output from the console when I use bmgr and I'm using the Lollipop devices.
LogCat gives me this message:
02-19 15:59:07.892: E/RestoreSession(948): java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.backup.dra(android.content.Context)' on a null object reference
Does someone know why this works on my Nexus 5 with Marshmallow but not on the two devices I've tried that runs Lollipop? The above message doesn't make any sense to me as I'm not calling the restore from code but from the command line.
Part of the manifest:
android:allowBackup="true"
android:icon="@drawable/icon_lightgreen"
android:label="@string/app_name"
android:theme="@style/MyMaterialTheme"
android:restoreAnyVersion="true"
android:backupAgent="com.zecave.petter.zeblocker.tools.BlacklistBackupAgent" >
<meta-data android:name="com.google.android.backup.api_key" android:value="AEdPqrEAAAAINjrn1*..." />
I have tried both
android:backupAgent=".tools.BlacklistBackupAgent"
android:backupAgent=".BlacklistBackupAgent"
But with the same result.
Edit: See the comment below for further explanation. Apparently it's not only my application that gives this error when trying to restore on the Lollipop devices.
Try changing the transport to:
adb shell bmgr transport android/com.android.internal.backup.LocalTransport
Google imposes a backup limit, and maybe that's why the why the data is not being backed up.
链接地址: http://www.djcxy.com/p/25496.html上一篇: PostgreSQL“DESCRIBE TABLE”
下一篇: 无法恢复包