Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

google play - Your Android App Bundle is signed with the wrong key. Ensure that your app bundle is signed with the correct signing key and try again

How do I sign my android app bundle with the correct signing key?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I tried using the multiple answers here & in this question, but somehow I was getting this error because I had some issues with my android/app/build.gradle and android/gradle.properties files.

Two things you should check (in addition to the other solutions here) are:

  1. In android/gradle.properties and android/app/build.gradle, make sure your keystore variables match exactly.
    • In android/gradle.properties, you probably have something like this:
      MYAPP_RELEASE_STORE_FILE=<>
      MYAPP_RELEASE_KEY_ALIAS=<>
      MYAPP_RELEASE_STORE_PASSWORD=<>
      MYAPP_RELEASE_KEY_PASSWORD=<>
      
    • Make sure these variable names exactly match those in android/app/build.gradle:
      android {
          ...
          signingConfigs {
              release {
                  if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                      storeFile file(MYAPP_RELEASE_STORE_FILE)
                      storePassword MYAPP_RELEASE_STORE_PASSWORD
                      keyAlias MYAPP_RELEASE_KEY_ALIAS
                      keyPassword MYAPP_RELEASE_KEY_PASSWORD
                  }
              }
          }
      }
      
  2. In android/app/build.gradle, make sure you set signingConfig to signingConfigs.release in your release buildTypes:
    android {
        ...
        buildTypes {
            debug ...
            release {
                signingConfig signingConfigs.release
            }
        }
    }
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...