I want to release an flutter app for Google play store and I checked every step of in Instruction page of flutter, but every time I got this error:
* What went wrong:Execution failed for task ':app:validateSigningRelease'.> Keystore file not set for signing config release
update: I waw wrong with naming key file :) it was key.propertis an 'e' has been left
You are probably missing the signingConfig for release inside your android/app/build.gradle file. It should look like this:
signingConfigs {
release {
keyAlias 'keyAlias'
keyPassword 'keyPassword'
storeFile file('storeLocation')
storePassword 'storePassword'
}
}
This should be put inside the android section.
I'm new to Flutter. I have created an app and now I'm trying to upload it to google play (Open testing track). Previously, I have uploaded a react-native version of my app. Now I would like to replace it with the flutter version. I have carefully followed the instructions from the official guidelines. No matter what I do, I'm getting the error:
Your Android App Bundle is signed with the wrong key. Ensure that your App Bundle is signed with the correct signing key and try again
I have looked at a number of similar issues on Stackoverflow. I have looked again and again at my app/build.gradle to make sure release mode is selected. I have cleaned every thing with flutter clean then re-generated the bundel (.app) with no success. Here is a portion of my app/build.gradle file:
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
I am at lost here, any help would be greatly appreciated. I don't know if the issue is related to the previous react-native artifact I have previously uploaded (which by the way, I can't delete from Google Play Console bundles explorer)
I just dont quite understand why is this happening to me.I followed all the steps as in https://flutter.dev/docs/deployment/android to upload my first version.There was something wrong in it.So I created another (a previous kind of backup project)flutter project and modified it to the existing one.I changed the com.flutterappstareawayvrsn1 which was initially something else.
I have put the key and it still shows the error:
Your Android App Bundle is signed with the wrong key. Ensure that your App Bundle is signed with the correct signing key and try again: :********************
How do you fix this thing?
I figured out what I was doing wrong.As per instructions in https://flutter.dev/docs/deployment/android
Original Code was:
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now,
// so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
The Modified code was to be:
With the 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
}
}
But I didnt modify buildtypes
{
..
.}
I took it for granted and kept it in debug rather than release
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?
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
My issue was that I've put the key.properties file in the folder /android/app and it was meant to be in /android/
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!
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).
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
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
}
}
My Problem was that I stored the key.properties file in app folder instead of android folder.
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
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']
}
}
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.
In my case this was because I have not added key.properties file and not even created my keystore
So what i have done. Creates a new keystore file and added new key.properties file in Folder[ android/ ]
First step is to create new keystore file with this command
For mac/linux
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
and for windows
keytool -genkey -v -keystore c:\Users\USER_NAME\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload
Second Step :
Create a new key.properties file and add to
android/key.properties
Make sure to provide password and storeFile like:
storePassword=<password from previous step>
keyPassword=<password from previous step>
keyAlias=upload
storeFile=<location of the key store file, such as /Users/<user name>/upload-keystore.jks>
Reference
Official flutter release build doc
originally app->build.gradle
buildTypes {
release {
signingConfig signingConfigs.release
}
}
just replace the release to debug in
signingConfigs.release to signingConfigs.debug.
Your problem will be solved
Thanks to #Tomas Baran
This worked for me
For windows user :
Place the key.jks file in /<project-directory>/android/app/Users/user_name/
Open key.properties file which must be (created and edited accordingly if not already) in the <project-directory>/android folder.
Now edit the value of the storeFile in key.properties file to /User/user_name/key.jks.
For Linux users :
Do same as instructed above from steps 1 to 2.
Edit the value of the storeFile in key.properties file to User/user_name/key.jks
NOTE: (preceeding / is removed).
That's it it should work for you now !
This states the path you stored the key.properties file on your application, keeping it inside the android folder is good since it concerns only the android signing
def keystorePropertiesFile = rootProject.file('app/key.properties')
Change this
storePassword=<XXXXX>
keyPassword=<XXXXXX>
keyAlias=key
storeFile=<C:/Users/saint/Desktop/key.jks>
to
storePassword=XXXXXX
keyPassword=XXXXXXXX
keyAlias=key
storeFile=D:/XXXX/XXXXX/key.jks
As meant by the documentation, I needed to run flutter clean
Specifically for error Flutter Issue | Keystore file not set for signing config release
It's a simple mistake. Check your key information file name.
I named it with can extra s e.g. keys.properties instead of key.properties
It was two parts that solved this for me:
I had to move the key.properties file from android/app to android.
I also had to change the slash in key.properties from
storeFile=c:\Users\MYNAME\key.jks to
storeFile=c:/Users/MYNAME/key.jks.
That worked to solve the issues for me.
I was able to fix it by the following operation using android studio.
Before fix
Create key.propeties from
File> New> File
image before fix
After fix
Create key.propeties from
File> New> Resource Bundle
image after fix
In my case, I originally set the path to my key.jks in the key.properties like this:
storeFile=~/key.jks
and it couldn't read it so all I had to do was change it to:
storeFile=Users/tomas/key.jks
My issue was related to how I was storing the CI variables in Gitlab. Turns out if CI Variables are protected, they will not be printed via echo to a file (which is what I was using). Unprotecting the variable fixed my issue (in a private repo) but that should not be done for public projects.
have you change for example the application ID ?
and check if the key.prporties file is there
The tutorial here has some issue https://flutter.dev/docs/deployment/android
In the key.properties remove any <> around the password
also in the path of the key , remove the quotations it will work
This looks like a error because you don't have a buildTypes{ release{ signingConfig signingConfigs.release} at your build.gradle... I had the same issue and this solution worked for me
I had exactly this error and I solved it by adding the drive name for storeFile, something like:
C:/xxx/xxx/key.jks
Of course, in Windows.
I just solved my problem using like this
storePassword=xxx
keyPassword=xxx
keyAlias=key
storeFile=F:\\xxx\\key.jks
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
}
I'm facing same problem. I solve my problem following this step:
Step 1: Put the upload-keystore.jks file in the project folder android/app
Step 2: Set path storeFile= ../app/upload-keystore.jks in key.properties file
Step 3: flutter clean
Step 4: flutter pub get
Step 5: flutter build apk or flutter build appbundle
My mistake was there was a space after the storeFile path like: storeFile=key.jks .
I just removed it and it worked.
key.properties file should add to your project for more info visit
https://docs.flutter.dev/deployment/android
I got stuck on this issue about near 1 hour and very stress. I followed exactly document but it doesn't work. Finally I sovled this by
Put key.properties in android/app
just insert relative path with your file name like this storeFile=your-key-file-name.jks
And ... boom, it works! Moreover, be sure:
In build.gradle def keystorePropertiesFile = file('key.properties')
Remove any redundant space in key.properties
Confirm and fill right keyAlias (upload is default)
Config sigining buildTypes {}
release {
signingConfig signingConfigs.release
}
I just change the store file path and add the drive name in KeyProperties.
like this:
storeFile=C:/Users/shb.g-keystore.jks