Error keystore tampered with or password incorrect when building appbundle with the correct keystore passowrd

huangapple go评论62阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年5月26日 07:37:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76336824.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定