在 adb 安装上安装 INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES [英] INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES on adb install

查看:73
本文介绍了在 adb 安装上安装 INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调试模式下构建同一个 Android 项目,有时使用 Eclipse,有时使用 ant(在构建机器上).

The same Android project is built in debug mode, sometimes with Eclipse, sometimes with ant (on build machine).

如果我先安装ant build,然后尝试启动Eclipse调试,Eclipse控制台显示

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] 由于应用程序签名不同,重新安装失败.[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] 发布取消!

[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!

如果我以相反的方式执行此操作,即使用 Eclipse 进行调试(包括安装 apk),然后尝试从命令行安装 ant 构建,我得到:

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:

失败 [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

我的证书/签名有什么问题?

What is wrong with my certificates/signing?

推荐答案

问题在于apk 文件(在 Eclipse 和 ant 构建期间)已使用不同的证书进行签名.要使在不同机器上构建的构建之间的签名保持一致,请将调试密钥库置于版本控制中:

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:

如果您倾向于从自己的机器和构建机器交叉安装构建,这会很方便.

This is handy if you tend to cross-install builds from your own machine and build machine.

这篇关于在 adb 安装上安装 INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆