androidflutterkeystoreandroid-keystoreandroid-app-bundle

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?


Solution

  • 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.