简体   繁体   English

程序包重命名后,BackupAgent失败

[英]BackupAgent fails after package rename

I have an app, that uses backup feature. 我有一个使用备份功能的应用程序。 This is line from my manifest: 这是我清单中的代码:

android:backupAgent="my.package.backup.BackupAgent"

It works fine in current version. 在当前版本中可以正常工作。 But now I want to move the same BackupAgent to another package my.package.other.backup.package . 但是现在我想将相同的BackupAgent移到另一个包my.package.other.backup.package

When I install new version to new device, it still works fine. 当我将新版本安装到新设备时,它仍然可以正常工作。 But when I try to install new version over old one - it causes backup agent to crash with error: 但是,当我尝试在旧版本上安装新版本时,它会导致备份代理崩溃并显示错误:

java.lang.ClassNotFoundException: my.package.backup.BackupAgent in loader dalvik.system.PathClassLoader

Why Android looks for BackupAgent in old package? 为什么Android在旧程序包中寻找BackupAgent

我仍然不知道如何解决这个问题,但是最后我只是在旧地方创建空类,扩展了新类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM