1

I finally creating an apk/aab file for the app that i need to upload in google play console when suddenly it print an error "You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode. " so after google for answer i follow the flutter guide on how to proper build and release but after completing all the instruction i can run the app in the vs code but when building an apk if failed and here is the log

"* What went wrong: Execution failed for task ':app:signReleaseBundle'.

A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable java.lang.NullPointerException (no error message)"

i cant find any solution please help me

1 Answers1

1

Create jks with normal generate build flow like android and use it as a .jks or type this common in your terminal

keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias aliasname -storetype JKS

For instance:

keytool -genkey -v -keystore /Users/mac/Desktop/Playstore_Live/appname.jks -keyalg RSA -keysize 2048 -validity 10000 -alias uploadAlias -storetype JKS

fill all Detail it will ask for

Reference the keystore from the app Create a file named [project]/android/key.properties that contains a reference to your keystore: Copy and paste in key.properties

storePassword=<password from previous step>
keyPassword=<password from previous step>
keyAlias=<Alias name from previous step> // uploadAlias
storeFile=<location of the key store file, such as /Users/<user name>/upload-keystore.jks>

Warning: Keep the key.properties file private; don’t check it into public source control. Configure signing in gradle

COPY AND PASTE IN [project]/android/app/build.gradle file before the android block.

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
      ...
}

And replace it with the following signing configuration info:content_copy

signingConfigs {
   release {
       keyAlias keystoreProperties['keyAlias']
       keyPassword keystoreProperties['keyPassword']
       storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
       storePassword keystoreProperties['storePassword']
   }
 }
buildTypes {
   release {
       signingConfig signingConfigs.release
   }

}

Create Build

  • flutter build apk --no-shrink
  • flutter build apk --release
  • flutter build appbundle
Sheetal Savani
  • 1,300
  • 1
  • 7
  • 21