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:
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
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.
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']
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With