即使使用相同的密钥库,更新 apk SHA1 也会有所不同 [英] Updating apk SHA1 differs even after using same keystore

查看:40
本文介绍了即使使用相同的密钥库,更新 apk SHA1 也会有所不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几个月前,我在使用发布密钥库对其进行签名后将我的应用上传到了 Goggle Play,我已经存储了该密钥库以备将来更新.

现在我已经更新了 apk 并进行了一些更改,同时尝试上传使用相同密钥库以及相同别名密码签名的新apk,该apk不允许上传到Goggle Play.Playstore 显示以下错误:

I have uploaded my app to Goggle Play few months back after signing it with a release keystore, I have stored that Keystore for future updation.

Now I have updated the apk with some changes, while trying to upload the new apk signed with same keystore along with same alias and password, the apk is not allowed to upload to Goggle Play. Playstore shows me following error :



唯一的变化是,之前应用程序是使用 eclipse 开发和构建的,现在在 android studio
这可能是显示上述错误的原因吗???



The only change is, earlier the appication was developed and build using eclipse and now in android studio
Can this be the reason for showing the above error???

推荐答案

根据错误消息,我会说您混淆了密钥库,或者 android studio 只是使用错误的密钥库来进行发布版本.完全确定的最好方法是清楚地设置您的 build.gradle,并使用

From the error message I would say you have mixed up the keystores, or android studio is just using the wrong one to do the release build. The best way to be completely sure is to clearly setup your build.gradle, and build it yourself on the command line using

 ./gradlew clean assembleRelease

可能发生的情况是 Android Studio 正在使用您的调试密钥库(即默认值)来签署发布版本,因为它找不到您在 eclipse 中使用的原始密钥库,或者您在某处输入了错误的密码..

What is probably happening is that Android Studio is using your debug keystore (ie. the default) to sign the release build because it can't find the original keystore you used in eclipse, or you have the wrong password somewhere...

看看这个配置,注意密钥库的位置、命名约定以及它如何对应于 build.gradle.请注意签名配置以及它们是如何为发布版本设置的.要从命令行构建,只需 cd 进入包含gradlew"文件的目录,然后运行 ​​

Have a look at this configuration, note the location of the keystores, the naming convention and how it corresponds to the build.gradle. Note the signingconfigs and how they are setup for the release build. To build from the command line, simply cd into the directory with your "gradlew" file, and run

./gradlew clean assembleRelease

构建发布apk,或

./gradlew clean assembleDebug

构建调试apk.如果失败,请尝试

to build the debug apk. If it fails, try

./gradlew clean assembleRelease --stacktrace

build.gradle 和文件系统设置的屏幕截图

但是请记住不要将您的密钥放在源代码管理中!这意味着编辑您的 .gitignore 文件.

But please remember not to put your keys in your source control! That means editing your .gitignore file.

这里有大量有关如何执行此操作的信息:http://developer.android.com/tools/publishing/app-signing.html

There is a stack of information on how to do this here: http://developer.android.com/tools/publishing/app-signing.html

这篇关于即使使用相同的密钥库,更新 apk SHA1 也会有所不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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