【问题标题】:Android : "Keystore was tampered with, or password was incorrect" after migrating from Eclipse to Android StudioAndroid:从 Eclipse 迁移到 Android Studio 后“密钥库被篡改,或密码不正确”
【发布时间】:2014-08-23 14:31:16
【问题描述】:

我一直在 Eclipse IDE 中开发我的项目。该应用已在 Play Store 上提交,并且我已成功发布了几个版本更新。

最近我迁移到了 Android Studio(当然还有 gradle)。我对项目代码库进行了一些更改,包括 min 和 target sdk 更改,但包名称保持不变。项目编译成功,调试应用成功组装,运行正常。

但现在我无法组装发布版本,因为:

Keystore was tampered with, or password was incorrect

密钥库没有改变,我知道它的密码。

我在 build.gradle 中设置了签名配置:

android {
  ...
  signingConfigs {
    release {
        storeFile file("keystore/motolife.keystore")
        storePassword "***"
        keyAlias "motolife"
        keyPassword "***"
    }
  }

  buildTypes {
    release {
        signingConfig signingConfigs.release
    }
  }
  ...
}

我也尝试过使用 jarsigner 进行签名:

jarsigner -verbose -keystore keystore/motolife.keystore build/outputs/apk/motolife-new-debug.apk motolife

但没有运气。 我什至为 Eclipse 安装了 gradle 支持并尝试组装签名发布应用程序,但得到了相同的“密钥库被篡改,或密码不正确”错误。

【问题讨论】:

  • 您的密码中是否包含任何复杂字符?我已经看到其中有逗号会导致问题。
  • @reidisaki,密码是字母数字,加上“@”符号
  • 是否可以尝试使用不带@ 的简单密码创建密钥库?我看到有人在迁移时遇到非字母数字符号的问题。
  • @reidisaki,由于该错误,我什至无法更改密钥库的密码。创建一个新的密钥库对我来说不是一个选项。
  • @alexaschka 你的问题有解决方案吗?请告诉我。

标签: android eclipse android-studio android-gradle-plugin signing


【解决方案1】:

然后尝试做这样的事情:

    release {
        storeFile file("keystoreName.keystore") //change value per signing
         def pass = System.console().readPassword("\nPlease enter key password: ")   
        pass = new String(pass)
        storePassword pass
        keyAlias "revision3" //need to change these values per signing
        keyPassword pass            
    }

【讨论】:

    猜你喜欢
    • 2012-12-21
    • 2016-04-10
    • 2017-11-20
    • 1970-01-01
    • 2015-09-22
    • 2012-08-22
    • 1970-01-01
    • 2012-03-07
    • 2014-12-24
    相关资源
    最近更新 更多