如何在不卸载的情况下处理INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES?

发布于 2024-09-08 07:41:44 字数 360 浏览 3 评论 0原文

我尝试重新安装 apk

$adb install -r new.apk

并显示错误:

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

一种解决方案是卸载并安装 new.apk,效果很好。

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

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

I tried to reinstall an 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.

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.

It would be great appreciated if you could tell me the whole meaning of the "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(16

臻嫒无言 2024-09-15 07:41:44

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

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.

仙气飘飘 2024-09-15 07:41:44

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

我通过删除通过 Marketplace 安装的应用程序来修复此问题(只需按住并拖动到垃圾桶)。此后,我能够毫无问题地部署我的开发版本。

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.

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.

日记撕了你也走了 2024-09-15 07:41:44

当团队中的另一位开发人员在我尝试部署到的硬件设备上构建我们的应用程序时,我就发生了这种情况。从硬件卸载应用程序解决了我的问题。

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.

旧时光的容颜 2024-09-15 07:41:44

这是使用 adb 从设备卸载应用程序的命令:

adb uninstall <package name>

This is the command to uninstall the app from device using adb:

adb uninstall <package name>
终止放荡 2024-09-15 07:41:44

即使在卸载原始 APK 后我仍然遇到此错误,这很令人困惑。最后我意识到我在 Nexus 7 上设置了多个用户进行测试,并且该应用程序仍然为其他用户之一安装。一旦我为所有用户卸载它,错误就消失了。

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.

悲欢浪云 2024-09-15 07:41:44

我在编写更新代码时更改了包名称,以便可以通过 Eclipse 在我的设备上调试它,而无需删除已安装的旧版本。如果不恢复尝试重新安装时使用的包名称,我会遇到同样的错误。使用相同的包名重新安装成功。

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.

一瞬间的火花 2024-09-15 07:41:44

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

谢谢

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..

Thanks

恋你朝朝暮暮 2024-09-15 07:41:44

我遇到了另一个用例,我遇到了类似的错误。
当我第一次收到错误时,我惊慌失措,并删除了 /data/data/{package.name}
之后我尝试了,我的问题仍然存在。
然后我尝试卸载,失败。

然后我删除了 /system/app 中存在的 apk 文件(需要 root 访问权限),并尝试卸载,结果成功。

之后我尝试重新安装apk,它成功了。

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.

I then removed the apk file present in /system/app (required root access), and tried uninstall and it was successfull.

After that I tried re-installing the apk, it worked.

却一份温柔 2024-09-15 07:41:44

如果您遇到 Andorid 设备或模拟器部署失败,并在输出窗口中出现错误“失败 [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]”,只需删除设备或模拟器上的现有应用程序并重新部署即可。调试版本将使用调试证书,而发布版本将使用您配置的证书。此错误只是让您知道设备上安装的应用程序的证书与您尝试安装的证书不同。在非开发(应用程序商店)场景中,这可能表明已损坏或经过其他修改的应用程序无法安全地安装在设备上。

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.

莫相离 2024-09-15 07:41:44

我遇到了同样的问题,直到我意识到我正在运行模拟器并且 adb 正在尝试在其上安装

I had the same problem until I realised I had the simulator running and adb was trying to install on that

初雪 2024-09-15 07:41:44

无论如何,我在向 Cordova 项目添加新插件后遇到了这个问题。我一直让 cordova 进行构建并通过 USB 直接安装在设备上。

我通过从设备上卸载应用程序来修复它,并且在下次部署时没有任何问题。

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.

I fixed it by uninstalling the app from the device and on the next deploy there were no problems.

水波映月 2024-09-15 07:41:44

上面的内容对我没有任何作用。对我来说,问题是我的 android-support-v7-appcompat 的 Java 构建路径中的源代码错误。当您转到“项目”>构建路径>配置构建路径>。在“源”选项卡下,确保您有 android-support-v7-appcompat/gen 、 android-support-v7-appcompat/libs 和 android-support-v7-appcompat/src ,没有其他内容。单击“确定”,它应该可以工作。

Nothing from above worked for me. The problem for me was that I had wrong source in my Java Build Path for android-support-v7-appcompat. When you go to Project> Build Path> Configure Build Path>. Under the Source tab make sure you have android-support-v7-appcompat/gen , android-support-v7-appcompat/libs and android-support-v7-appcompat/src and nothing else. Click OK and it should work.

薄荷港 2024-09-15 07:41:44

我今天也遇到了同样的错误,但问题并不完全相同。我正在使用安装在 VirtualBox 中的 Android 的 ADB。我尝试安装不同版本的应用程序(签名/未签名、调试/发布模式),但交替出现两个错误:INSTALL_FAILED_UID_CHANGEDINSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES

现在,当查看 /data/data/{package.name} 时,我发现卸载应用程序后一堆文件仍然存在。我尝试 rm -rf 它们但没有成功:我遇到了 I/O 错误。

解决方案是:

  • 关闭虚拟机
  • 使用 vdfuse 挂载 VDI 映像(读/写)
  • 使用 e2fsck 修复 Partition1 映像文件
  • 卸载并重新启动虚拟机

I've had the same error today, but the problem wasn’t exactly the same. I’m using ADB with Android installed in VirtualBox. I tried to install different versions of my app (signed / not signed, debug / release mode) and got two errors alternatively : INSTALL_FAILED_UID_CHANGED and INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES.

Now, when looking at /data/data/{package.name}, I found a bunch of files that were still there after uninstalling the app. I tried to rm -rf them without success : I got I/O errors.

The solution to this was :

  • Shut down the VM
  • Mount the VDI image with vdfuse (read/write)
  • Repair the Partition1 image file with e2fsck
  • Umount and restart the VM
离去的眼神 2024-09-15 07:41:44

由于验证是基于包的名称,因此您可以将 config.xml 或清单文件中的包名称更改为您想要的其他名称。

发布您的应用时不要忘记改回名称!

Since the verification is based on package's name, you can change the package name inside your config.xml or manifest file for another name you want.

When publishing your app don't forget to change back the name!

旧时浪漫 2024-09-15 07:41:44

我尝试在 Genymotion 上执行 gradle 任务 connectedDebugAndoidTest (或 connectedAndroidTest)时遇到此问题。在普通模拟器上运行它解决了问题。

I had this problem trying to execute gradle task connectedDebugAndoidTest (or connectedAndroidTest) on Genymotion. Running it on normal emulator solved the problem.

无人问我粥可暖 2024-09-15 07:41:44

我认为,您的应用程序是由其他帐户安装的。(多帐户模式功能)您可以在设置>应用程序>“应用程序名称”>中卸载应用程序。卸载

I think , your app installed by other account.( multiple account mode feature ) You can uninstall app in Setting>Apps>"app name"> Uninstall

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文