Home > database >  Flutter build appbundle failed
Flutter build appbundle failed

Time:03-30

I'm trying to build my flutter appbundle but I got an error saying:

Execution failed for task ':app:validateSigningRelease'.
> Keystore file '/Users/user/key.jks' not found for signing config 'release'.

Here is my release in build.gradle:


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

Is there a way to fix this?

CodePudding user response:

Looks like your keystore file path is not valid and as I don't know where you put your key.jks file then you may follow these steps.

  1. Move/paste your key.jks file inside your project's {project-root}/android/app/

  2. Create keystore properties file key.properties in your project's {project-root}/android module and use this code and replace **** with your value/keys

    storePassword=****
    keyPassword=*****
    keyAlias=****
    storeFile=./key.jks
    
  3. Open {project-root}/android/app/build.gradle and paste this code inside signingConfigs

    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile file(keystoreProperties['storeFile'])
        storePassword keystoreProperties['storePassword']
    }
    
  4. Add this block before android section in app/build.gradle

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

CodePudding user response:

here is the documentation how you implement

https://docs.flutter.dev/deployment/android

  • Related