我试着重新安装apk

$adb install -r new.apk

它显示了错误:

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

一种解决方案是卸载并安装新的。apk,这很好。

但我想知道我是否可以重新构建apk并重新安装而不卸载。如。修改AndroidManifest.xml中的一些配置,或者不签署APK,等等。

如果您能告诉我“INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES”的全部含义,将不胜感激。


当前回答

我在编写更新代码时更改了包的名称,这样我就可以通过Eclipse在我的设备上调试它,而不用删除已安装的旧版本。没有恢复我试图重新安装时使用的包名,我得到了同样的错误。使用相同的包名重新安装成功。

其他回答

只需从设备中删除旧版本并重新安装即可。因为设备。密钥存储库已经存在于设备中,所以只需卸载构建并重新安装APK即可。

谢谢

我在测试一台新的Xoom时遇到了这个问题。我之前是在Marketplace上安装应用的。后来在测试新版本的应用程序时,我遇到了这个错误。

我通过删除通过Marketplace安装的应用程序来解决这个问题(只需按住并拖动到垃圾桶)。此后,我就可以毫无问题地部署我的开发版本了。

由于验证是基于包的名称,所以您可以在config.xml或清单文件中更改包的名称。

在发布应用程序时,不要忘记更改名称!

If you encounter a failed deployment to an Andorid device or emulator with the error "Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]" in the Output Window, simply delete the existing app on the device or emulator and redeploy. Debug builds will use a debug certificate while Release builds will use your configured certificate. This error is simply letting you know that the certificate of the app installed on the device is different than the one you are attempting to install. In non-development (app store) scenarios, this can be indicator of a corrupted or otherwise modified app not safe to install on the device.

这意味着应用程序的新副本(在开发机器上)与应用程序的旧副本(安装在设备/模拟器上)使用不同的签名密钥进行签名。例如,如果这是一个设备,您可能已经从不同的开发机器(例如,其他开发人员的机器)上放置了旧的副本。或者,旧的用您的生产密钥签名,新的用您的调试密钥签名。