Have faced this issue multiple times now trying to build APK/App bundle with Flutter, can anyone tell what the issue is? It's saying my key.properties file is missing the store file, however it's definitely there and is 100% the correct path
My build gradle:
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
My key.properties file(this is at the root of the flutter project):
storePassword=******
keyPassword=******
keyAlias=*****
storeFile=/Users/user/keystore/my_app/*****.jks
CodePudding user response:
Is this the exact storefile path you added?
storeFile=/Users/user/keystore/my_app/*****.jks
If yes, then your location is probably incomplete.
It should look like this
storeFile=C:/Users/user/keystore/my_app/*****.jks
This is how it should start
C:/Users
or D:/Users
Edited based on inputs from comment
Your key.properties
file is at the root of Flutter project.
It actually has to be inside the /android
folder.
Try moving it to android folder such that its location is like this
[project]/android/key.properties
CodePudding user response:
- Put your
key.properties
file inside the android folder of your project.
[Project]/android/key.properties
- Edit your storeFile path on the
key.properties
with the jks file name only.
- Add the jks file inside the android/app folder of your project.
NOTE: If this project is on a public repo add on android/.gitignore the jks and key.properties for security reasons.