什么是PolicyException?我在Android上找不到任何关于此的信息

时间:2014-11-14 03:18:40

标签: android android-service android-backup-service

当我的应用尝试使用BackupTransportService备份其数据时,我在堆栈跟踪中收到此错误。我在网上找不到任何关于它的信息,因此无法弄清楚我的备份失败的原因。有什么想法吗?

11-13 19:53:44.481: D/PerformBackupTask(352): starting agent for backup of BackupRequest{pkg=com.NsouthProductions.gradetrackerpro}
11-13 19:53:44.501: I/BackupManagerService(352): got agent android.app.IBackupAgent$Stub$Proxy@441b7118
11-13 19:53:44.501: D/PerformBackupTask(352): invokeAgentForBackup on com.NsouthProductions.gradetrackerpro
11-13 19:53:44.511: V/BackupServiceBinder(30648): doBackup() invoked
11-13 19:53:44.511: D/GradeTracker.MyBackupAgent(30648): onBackup called
11-13 19:53:44.511: D/BackupHelperDispatcher(30648): handling existing helper 'GradeTracker.db' android.app.backup.FileBackupHelper@425a93e0
11-13 19:53:45.382: E/BackupTransportService(352): com.google.android.backup.BackupRequestGenerator$PolicyException: server error in app com.NsouthProductions.gradetrackerpro: code 7
11-13 19:53:45.382: E/BackupTransportService(352):  at com.google.android.backup.BackupRequestGenerator.parseResponse(BackupRequestGenerator.java:360)
11-13 19:53:45.382: E/BackupTransportService(352):  at com.google.android.backup.BackupTransportService.sendRequestLocked(BackupTransportService.java:849)
11-13 19:53:45.382: E/BackupTransportService(352):  at com.google.android.backup.BackupTransportService.access$600(BackupTransportService.java:78)
11-13 19:53:45.382: E/BackupTransportService(352):  at com.google.android.backup.BackupTransportService$1.finishBackup(BackupTransportService.java:444)
11-13 19:53:45.382: E/BackupTransportService(352):  at com.android.server.BackupManagerService$PerformBackupTask.operationComplete(BackupManagerService.java:2320)
11-13 19:53:45.382: E/BackupTransportService(352):  at com.android.server.BackupManagerService$BackupHandler.handleMessage(BackupManagerService.java:572)
11-13 19:53:45.552: I/PerformBackupTask(352): Backup pass finished.

1 个答案:

答案 0 :(得分:0)

解决了!我的Android备份服务密钥显然很糟糕。我的清单中的包名有几个大写字母,所以我想"也许我应该确保我的密钥是使用相同大小写的包名生成的。"所以我再次使用我的清单直接复制/粘贴我的包名称,我得到了一个不同的密钥,现在似乎正在工作。