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.
Move/paste your key.jks file inside your project's
{project-root}/android/app/
Create keystore properties file
key.properties
in your project's{project-root}/android
module and use this code and replace****
with your value/keysstorePassword=**** keyPassword=***** keyAlias=**** storeFile=./key.jks
Open
{project-root}/android/app/build.gradle
and paste this code insidesigningConfigs
release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile file(keystoreProperties['storeFile']) storePassword keystoreProperties['storePassword'] }
Add this block before
android
section inapp/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