Search code examples
androidfluttergoogle-play-consoleandroid-app-signing

How do I sign my flutter app for google play store?


I went to build a new release of my app today and was stopped with a signing error:

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:SHA1: DF:2F...

I haven't changed anything with my keystore or signing process in the instructions here https://flutter.dev/docs/deployment/android. My last release to production was Aug 29, 2020, so how can I tell if Google Play Console changed the default signing process? I'm at a loss about what's different now.

[✓] Flutter (Channel stable, 1.22.2, on Mac OS X 10.15.7 19H2, locale en-US)
    • Flutter version 1.22.2 at /Users/*/development/flutter
    • Framework revision 84f3d28555 (4 months ago), 2020-10-15 16:26:19 -0700
    • Engine revision b8752bbfff
    • Dart version 2.10.2

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/*/Library/Android/sdk
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

Solution

  • You should find the *.jks file and key + keystore passwords which you use to upload app bundle or apk for the latest release. May be they were stored in your git, passwords may be in build.gradle (unsafe options, but someone do that). This keystore file and passwords are very important. You should make a backup somewhere safe.

    If you lost the keystore file, try to contact Google Play support to upload new keystore file certificate. Another extreme option is to delete the app from Google Play and create a new one with new keystore.