Home > Back-end >  Flutter error: Execution failed for task ':app:signReleaseBundle'
Flutter error: Execution failed for task ':app:signReleaseBundle'

Time:08-17

I'm trying to sign and publish the project and when I run "flutter build appbundle" I get the following error.

FAILURE: Build failed with an exception.

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

my key.properties file:

storePassword=dehset21    
keyPassword=dehset21
keyAlias=upload
storeFile=E:/ariyorum/android/app/upload-keystore.jks

i think i did the steps correctly and i couldn't find a solution when i searched for this error on the internet.

my build.gradle file: above android tag there is the code

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

in android tag:

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

CodePudding user response:

Did you update local.properties file for release ?

sdk.dir=<path>
flutter.sdk=<path>
flutter.buildMode=release
flutter.versionName=1.0.0
flutter.versionCode=1

CodePudding user response:

I moved the key.properties file into the android folder. I created a new key and placed it in the android/app folder. With this method i fix it,thanks :)

  • Related