Android 不卸载如何处理INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3185444/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to deal with INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES without uninstallation
提问by Johnny
I tried to reinstall an apk
我试图重新安装一个 apk
$adb install -r new.apk
And it shows the error:
它显示了错误:
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
One solution is to uninstall and install the new.apk, that works fine.
一种解决方案是卸载并安装 new.apk,效果很好。
But I'm wondering whether I could re-build an apk and re-install without the uninstallation. Eg. change some config in the AndroidManifest.xml, or not sign the APK, etc.
但我想知道我是否可以重新构建一个 apk 并在不卸载的情况下重新安装。例如。更改 AndroidManifest.xml 中的一些配置,或者不签署 APK 等。
It would be great appreciated if you could tell me the whole meaning of the "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES".
如果您能告诉我“INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES”的全部含义,将不胜感激。
回答by CommonsWare
It means the new copy of your application (on your development machine) was signed with a different signing key than the old copy of your application (installed on the device/emulator). For example, if this is a device, you might have put the old copy on from a different development machine (e.g., some other developer's machine). Or, the old one is signed with your production key and the new one is signed with your debug key.
这意味着您的应用程序的新副本(在您的开发机器上)使用的签名密钥与您的应用程序的旧副本(安装在设备/模拟器上)不同。例如,如果这是一个设备,您可能已经从不同的开发机器(例如,某些其他开发人员的机器)上放置了旧副本。或者,旧的使用您的生产密钥签名,而新的使用您的调试密钥签名。
回答by George Armhold
I ran into this while testing on a new Xoom. I had previously installed my app from the Marketplace. Later while trying to test a new version of the app I ran into this error.
我在新 Xoom 上测试时遇到了这个问题。我之前从 Marketplace 安装了我的应用程序。后来在尝试测试新版本的应用程序时,我遇到了这个错误。
I fixed it by removing the app that was installed via Marketplace (just hold and drag to the trash). Thereafter I was able to deploy my development version without any issue.
我通过删除通过 Marketplace 安装的应用程序来修复它(只需按住并拖动到垃圾箱)。此后,我能够毫无问题地部署我的开发版本。
回答by supermoogle
This happened to me when another developer on the team built our app on the hardware device I was trying to deploy to. Uninstalling the app from hardware fixed my problem.
当团队中的另一位开发人员在我尝试部署到的硬件设备上构建我们的应用程序时,这发生在我身上。从硬件卸载应用程序解决了我的问题。
回答by Paul
This is the command to uninstall the app from device using adb:
这是使用 adb 从设备卸载应用程序的命令:
adb uninstall <package name>
回答by inky
I got this error even after uninstalling the original APK, which was mystifying. Finally I realized that I had set up multiple users on my Nexus 7 for testing and that the app was still installed for one of the other users. Once I uninstalled it for all users the error went away.
即使在卸载原始 APK 后,我也收到此错误,这令人困惑。最后我意识到我已经在我的 Nexus 7 上设置了多个用户进行测试,并且该应用程序仍然为其他用户之一安装。一旦我为所有用户卸载它,错误就消失了。
回答by Edward
I changed the package name while coding an update so that I could debug it on my device via Eclipse, without deleting the old version that was installed. Without reverting the package name I was using when trying to reinstall, I got this same error. Using the same package name the reinstall was successful.
我在编写更新时更改了包名称,以便我可以通过 Eclipse 在我的设备上调试它,而不会删除已安装的旧版本。在尝试重新安装时没有恢复我使用的包名称,我遇到了同样的错误。使用相同的包名重新安装成功。
回答by Arunkumar
I faced an another use case where I got the similar error.
When At first I got the error, I panicked, and removed /data/data/{package.name}
After that I tried, and my problem was still present.
Then I tried uninstall, it failed.
我遇到了另一个用例,我遇到了类似的错误。当起初我得到错误时,我惊慌失措,并删除了/data/data/{package.name}
之后我尝试了,我的问题仍然存在。然后我尝试卸载,它失败了。
I then removed the apk file present in /system/app
(required root access), and tried uninstall and it was successfull.
然后我删除了/system/app
(需要 root 访问权限)中存在的 apk 文件,并尝试卸载并成功。
After that I tried re-installing the apk, it worked.
之后我尝试重新安装apk,它起作用了。
回答by user1330971
Just delete the old build from the device and reinstall the same. Because device.keystore is already exist in the device so just uninstall the build and reinstall the APK thats all..
只需从设备中删除旧版本并重新安装即可。因为 device.keystore 已经存在于设备中,所以只需卸载构建并重新安装 APK 即可。
Thanks
谢谢
回答by radicalmatt
For what it is worth, I ran into this problem after adding a new plugin to my Cordova project. I had been having cordova do builds and install directly on the device via USB.
值得一提的是,在向我的 Cordova 项目添加新插件后,我遇到了这个问题。我一直在通过 USB 直接在设备上构建和安装cordova。
I fixed it by uninstalling the app from the device and on the next deploy there were no problems.
我通过从设备上卸载应用程序来修复它,并且在下一次部署时没有问题。
回答by Linda Z
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.
如果您遇到无法部署到 Andorid 设备或模拟器并在输出窗口中显示错误“Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]”的问题,只需删除设备或模拟器上的现有应用程序并重新部署即可。调试版本将使用调试证书,而发布版本将使用您配置的证书。此错误只是让您知道设备上安装的应用程序的证书与您尝试安装的证书不同。在非开发(应用程序商店)场景中,这可能表明已损坏或以其他方式修改的应用程序无法安全安装在设备上。