Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How create keystore for release and not on debug? flutter

I followed the steps for deployment for flutter using this website https://flutter.io/android-release/

And when i run flutter build apk i get this error

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

what i'm i missing to make it so it will sign for release?

when i change the line signingConfig signingConfigs.release to signingConfig signingConfigs.debug in my build.gradle it works, but to need it to be sign for release

my build.gradle

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

            minifyEnabled true
            useProguard true

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

folder structure:

Project

-Android
|-- .gradle
|-- app
|   |-- src
|   |   `-- main
|   |       |-- java
|   |       |-- res
|   |       `-- AndroidManifest.xml
|   `-- build.gradle
|-- gradle
|   `-- wrapper
|-- gradle.properties
|-- gradlew
|-- local.properties
|-- proguard-rules.pro
|-- gradlew.bat
`-- key.properties

i left out files under wrapper, java, and res

key.properties

storePassword=<placeholder1>
keyPassword=<placeholder1>
keyAlias=key
storeFile=</Users/Conner/key.jks>
like image 443
Mfreeman Avatar asked Sep 20 '18 20:09

Mfreeman


2 Answers

You must remove the '<' chars, it's only as sample data.

storePassword=yourpasswordhere
keyPassword=yourkeypasswordhere
keyAlias=youralias
storeFile=/your/path/key.jks
like image 200
diegoveloper Avatar answered Sep 25 '22 01:09

diegoveloper


To avoid conflicts place the key.jks file inside android\app\key folder and in key.properties file add

storePassword=yourpasswordhere keyPassword=yourkeypasswordhere keyAlias=youralias storeFile=key/key.jks

like image 26
silexcorp Avatar answered Sep 24 '22 01:09

silexcorp