Android:错误-应用具有相同的打包不同签名 [英] Android: Error - App has same packaged different signature

查看:344
本文介绍了Android:错误-应用具有相同的打包不同签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了android studio所说的问题

I am getting an issue where android studio is saying

 Installation failed since the device has an application with the same package but a different signature. . . .. 

这是正确的,因为我最近签署了一个APK并上传到了我的Play开发者控制台的Beta版区域.

This is correct, as I recently signed an APK and uploaded to the beta area of my play developer console.

现在我正在尝试在本地对其进行调试,并且默认情况下,我相信所有Android项目均由调试密钥库签名,因此签名会有所不同.

And now I am trying to debug it locally and by default I believe that all Android projects are signed by the debug keystore hence the signatures would be different.

处理此问题的最佳方法是什么?可以使用我的发布密钥对调试版本进行签名,这里有潜在的危险吗?

What is the best way to deal with this? Would it be possible to sign my debug version with my release key, and is there a potential danger here?

如何在不失去调试能力的情况下强制使用发布密钥库对调试版本进行签名?

How would I force the signing of my debug version with my release keystore without losing the ability to debug, etc.?

或者我应该继续卸载并重新安装不同的版本-这似乎是最糟糕的解决方法. :-)

Or should I just keep uninstalling and reinstalling the different versions - that seems the worst possible workaround. :-)

推荐答案

您可以使用发布密钥对应用程序进行签名,同时保留调试选项-您只需将发布密钥添加到Android Studio中(或在命令中指定发布密钥即可)行(如果您在此处对应用程序进行签名).

You can sign your apps with your release key while keeping the debugging option - you just have to add your release key into Android Studio (or specify it on the command line if you are signing your apps there).

在Android Studio中,在项目浏览器中右键单击您的应用,然后打开模块设置.选择应用程序的模块,然后单击签名"以确保列出了您的发布密钥库.然后,在构建类型"下,确保调试目标和发行目标共享相同的签名配置,并且确保调试目标的debuggable设置为true.他们现在应该共享相同的密钥.

In Android Studio, right click on your app in the project browser and open module settings. Select your app's module and click on 'Signing' to make sure your release keystore is listed. Then under 'Build Types', make sure that the debug target and the release target share the same signing config, and that the debug target has debuggable set to true. They should now share the same key.

有关应用程序签名的更多信息,请参见开发人员文档此处.

More information on app signing can be found in the Developer docs here.

我还没有听说过使用相同的密钥进行调试和发布的弊端,但前提是私有密钥必须保持安全(阅读:不受版本控制).

I haven't heard of a downside to using the same key for debugging and for release, provided the private key is kept secure (read: not under version control).

这篇关于Android:错误-应用具有相同的打包不同签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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