Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Issue | Keystore file not set for signing config release

Tags:

flutter

Running the command flutter build appbundle --release or flutter build apk --release I have this issue

Keystore file not set for signing config release

I'd follow the steps of the flutter.dev/docs: https://flutter.dev/docs/deployment/android#configure-signing-in-gradle but still the same.

I create the key.propeties file and replace the content in the build.grade file.

Build.gradle

Key.properties

Also replace de build types with:

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

But still getting the same issue:

  • What went wrong: Execution failed for task ':app:validateSigningRelease'.

Keystore file not set for signing config release

Somebody already solve this issue?

like image 644
Edmoon10 Avatar asked May 14 '20 01:05

Edmoon10


10 Answers

The instructions here did not work for me out of the box. I had to change the key.properties file path to:

def keystorePropertiesFile = rootProject.file('app/key.properties')

You can test your configuration is being read properly or not by printing the values to the console. For example, in your gradle file you can have:

println keystorePropertiesFile

to make sure that object is populated with the values you expect

like image 127
Tony Avatar answered Oct 21 '22 21:10

Tony


My issue was that I've put the key.properties file in the folder /android/app and it was meant to be in /android/

like image 27
drpawelo Avatar answered Oct 21 '22 21:10

drpawelo


This one is for windows users. Inside key.properties i was using:

storeFile= C:\users\username\key.jks

instead we need to use:

storeFile= C:/users/username/key.jks

This solved my issue!

like image 9
Apoorv pandey Avatar answered Oct 21 '22 20:10

Apoorv pandey


The same problem I faced and after doing lots of R&D .... I have done these: First Executed this command:keytool -genkey -v -keystore c:\Users\Ziya\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key

Then in key.properties: Changed the storeFile to this value: C:\\Users\\Ziya\\key.jks

Then Result I got:

flutter build appbundle
Running Gradle task 'bundleRelease'...

Running Gradle task 'bundleRelease'... Done
    5.3s
√ Built build\app\outputs\bundle\release\app-release.aab        
(17.7MB).
like image 8
ZiauddinZiya07 Avatar answered Oct 21 '22 21:10

ZiauddinZiya07


You have to Create a file that have key prperties in path like that

[project]/android/key.properties 

And that's File data

storePassword=password
keyPassword=password
keyAlias=upload
storeFile=C:/user/project/upload-keystore.jks
like image 7
Omar Essam Avatar answered Oct 21 '22 20:10

Omar Essam


If you want to build APK files for testing purposes make sure that you use a debug signing configuration in android/app/build.gradle:

buildTypes {
    release {
        signingConfig signingConfigs.debug
    }
}
like image 6
Yonatan Naor Avatar answered Oct 21 '22 20:10

Yonatan Naor


My Problem was that I stored the key.properties file in app folder instead of android folder.

like image 6
Karem Mohamed Avatar answered Oct 21 '22 20:10

Karem Mohamed


Try removing " from the path mentioned for keystore file

that seems to be the problem.

contents of key.properties files should be like this

storePassword=XXXXXX
keyPassword=XXXXXXXX
keyAlias=key
storeFile=D:/XXXX/XXXXX/key.jks
like image 5
Vicky Salunkhe Avatar answered Oct 21 '22 20:10

Vicky Salunkhe


Create a key.properties file inside the android folder. If you created a key.properties file inside app folder then maybe this error occurs. I also have faced this issue.

like image 4
NASEER ULLAH Avatar answered Oct 21 '22 19:10

NASEER ULLAH


My mistake was to insert values instead of variables. Do not change signingConfigs {...} block

Mistake:

signingConfigs {
    release {
        keyAlias keystoreProperties['key']
        keyPassword keystoreProperties['12345678qwerty']
        storeFile keystoreProperties['/Users/Me/key.jks'] ? file(keystoreProperties['/Users/Me/key.jks']) : null
        storePassword keystoreProperties['12345678qwerty']
    }
}

Right code:

signingConfigs {
    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
        storePassword keystoreProperties['storePassword']
    }
}
like image 3
Vladimir Khrolovich Avatar answered Oct 21 '22 19:10

Vladimir Khrolovich