安卓应用未安装.已经安装了具有冲突签名的同名现有包 [英] Android App Not Install. An existing package by the same name with a conflicting signature is already installed

查看:44
本文介绍了安卓应用未安装.已经安装了具有冲突签名的同名现有包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的模拟器中,当我尝试以编程方式升级我的 apk 时.我得到:

In my emulator, when I try to do an upgrade of my apk programmatically. I get:

Android 应用未安装.

已安装同名但签名冲突的现有包

我仍处于这次升级的测试阶段,所以我下载的文件是以前版本的签名 apk,我认为应该可以正常工作.

I'm still in the testing phase of this upgrade, so the file I download is a signed apk of a previous version, which I think should work without any issues.

来自以下建议:已经安装了具有冲突签名的同名现有包 我尝试在调试模式和正常模式下运行模拟器......都没有奏效.

From the suggestion in: an existing package by the same name with a confilcting signature is already installed I tried to run the emulator both in debug mode and in normal mode... neither worked.

对我缺少的东西有什么想法吗?

Any thoughts on what I'm missing?

推荐答案

问题是用于签署 APK 的密钥,默认情况下,如果您直接从 IDE 运行并打开模拟器,APK 安装在模拟器使用您的调试密钥(通常安装在 ~/.android/debug.keystore 中)进行签名,因此如果以前的 APK 使用与您当前使用的密钥不同的密钥签名,您将始终遇到签名冲突,为了修复它,请确保您使用完全相同的密钥对两个 APK 进行签名,即使之前的 APK 是使用来自另一个 SDK 的调试密钥签名的,密钥肯定会有所不同.

The problem is the keys that have been used to sign the APKs, by default if you are running directly from your IDE and opening your Emulator, the APK installed in the Emulator is signed with your debug-key(usually installed in ~/.android/debug.keystore), so if the previous APK was signed with a different key other than the one you are currently using you will always get the signatures conflict, in order to fix it, make sure you are using the very same key to sign both APKs, even if the previous APK was signed with a debug-key from another SDK, the keys will definitely be different.

此外,如果您不知道之前使用什么密钥对 apk 进行签名,但又想安装新版本的应用程序,则只需卸载以前的应用程序并重新安装新的应用程序即可.

Also if you don't know exactly what key was used before to sign the apk and yet you want to install the new version of your app, you can just uninstall the previous application and reinstall the new one.

希望这有助于...

问候!

这篇关于安卓应用未安装.已经安装了具有冲突签名的同名现有包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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