在adb安装上INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES [英] INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES on adb install
问题描述
如果我第一次安装ant构建,然后尝试启动Eclipse调试,Eclipse控制台显示
[2012-03-20 13:32:26 - myproject]重新安装由于不同的应用程序签名失败。
[2012-03-20 13:32:26 - myproject]您必须对应用程序执行完全卸载。警告:这将删除应用程序数据!
[2012-03-20 13:32:26 - myproject]请在shell中执行adb uninstall com.myproject。
[2012-03-20 13:32:26 - myproject]启动取消!
如果我这样做方法,即使用Eclipse调试(包括安装apk),然后尝试从命令行安装蚂蚁构建,我得到:
失败[INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
我的证书/签名有什么问题?
问题是, apk文件(在Eclipse和ant构建期间)已使用不同的证书签名。要使签名在不同机器上构建的构建之间保持一致,请将调试密钥库放在版本控制中:
- 使用keytool-importkeypair使钥匙/证书对:
https://stackoverflow.com/a/4257367/1097104 - 将创建的密钥库文件放在版本控制中
- 将Eclipse设置为使用该文件:Windows>首选项> Android> Build
- 设置ant属性以使用该文件: https://stackoverflow.com/a/9019925/1097104
如果您倾向于从自己的机器和构建机器交叉安装构建,那么这是很方便的。
The same Android project is built in debug mode, sometimes with Eclipse, sometimes with ant (on build machine).
If I first install the ant build, and then try to start Eclipse debugging, the Eclipse console displays
[2012-03-20 13:32:26 - myproject] Re-installation failed due to different application signatures. [2012-03-20 13:32:26 - myproject] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2012-03-20 13:32:26 - myproject] Please execute 'adb uninstall com.myproject' in a shell. [2012-03-20 13:32:26 - myproject] Launch canceled!
If I do this the other way around, i.e., debug with Eclipse (includes installing the apk) and then try to install the ant build from command line, I get:
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
What is wrong with my certificates/signing?
The problem is that the apk files (during Eclipse and ant build) have been signed with different certificates. To make the signatures consistent between builds that have been built on different machines, place the debug keystore in version control:
- Use keytool-importkeypair to make the key/certificate pair: https://stackoverflow.com/a/4257367/1097104
- Place the created keystore file in version control
- Set Eclipse to use the file: Windows > Preferences > Android > Build
- Set ant properties to use the file: https://stackoverflow.com/a/9019925/1097104
This is handy if you tend to cross-install builds from your own machine and build machine.
这篇关于在adb安装上INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!