英文:
Error keystore tampered with or password incorrect when building appbundle with the correct keystore passowrd
问题
I have a problem with keystore.jks file in my flutter app,
I'm able to open the keystore.jks file with keytool -list -v -keystore keystore.jks
command with the password (not any default password where you get a warning), but When trying to build appbundle It fails with error:
Keystore was tampered with, or password was incorrect...
What can I do in a situation like this?
PS: The app is not new and was already uploaded to Google Play, I had been failing at the keytool command with a wrong password for a while and I tried another password now and it worked.
Also I'm building the app on another pc than where the keystore file was generated, does that affect anything?
英文:
I have a problem with keystore.jks file in my flutter app,
I'm able to open the keystore.jks file with keytool -list -v -keystore keystore.jks
command with the password (not any default password where you get a warning), but When trying to build appbundle It fails with error:
Keystore was tampered with, or password was incorrect...
What can I do in a situation like this?
PS: The app is not new and was already uploaded to Google Play, I had been failing at the keytool command with a wrong password for a while and I tried another password now and it worked.
Also I'm building the app on another pc than where the keystore file was generated, does that affect anything?
答案1
得分: 1
分享我是如何解决的,也许对其他人有所帮助,
我能够通过将存储的凭据移到build.gradle中而不是从key.properties中调用它们来构建appbundle,尽管我已经按照要求拥有了key.properties和keystore文件。
所以,我将原来的代码:
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
更改为:
signingConfigs {
release {
keyAlias 'myKey'
keyPassword "keyPassword"
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword "storePassword"
}
}
当然,不要将这些更改提交到git中,以免泄漏jks文件的凭据。
英文:
Sharing how I solved maybe it helps someone else,
I was able to build appbundle with moving the credentials of the store in build.gradle rather than calling them from key.properties, even though I had the key.properties and keystore files as required.
So instead of this:
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
I did this:
signingConfigs {
release {
keyAlias 'myKey'
keyPassword "keyPassword"
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword "storePassword"
}
}
And of course don't commit those changes to git so you don't share the credentials to the jks file.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论