user14736790
user14736790

Reputation:

You have sent a signed APK or Android App Bundle in debug mode. Sign it in release mode. How to fix it (flutter)

I have to generate an APK to publish the app in Google Play Store, so I did this steps:

storePassword=myPass
keyPassword=myPass
keyAlias=KEY
storeFile=/app/key.jks
def keystoreProperties = new Properties()
   def keystorePropertiesFile = rootProject.file('key.properties')
   if (keystorePropertiesFile.exists()) {
       keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
   }
    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now,
            // so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }

But when I send the apks to google play publish I receive this message:

You have sent a signed APK or Android App Bundle in debug mode. Sign it in release mode

What I need to do?

Upvotes: 1

Views: 2892

Answers (1)

Chance
Chance

Reputation: 1654

Remove the duplicate buildType release

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now,
            // so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }

Or rename to debug.

buildTypes {
    release {
        signingConfig signingConfigs.release
    }
    debug {
        signingConfig signingConfigs.debug
    }
}

Upvotes: 3

Related Questions