I have reviewed a number of posts on this topic,
for starters. But I still cannot get past the Gradle error Error:(69, 0) Could not find method storeFile() for arguments [/path/to/my.keystore]
on line 69:
storeFile file(keystoreProperties['storeFile'])
in the module gradle build file - contents of my module gradle.build file:
apply plugin: 'com.android.application'
apply plugin: 'signing'
android {
...
buildTypes {
...
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
def keystorePropertiesFile = rootProject.file("keystore.properties");
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
}
...
}
...
}
...
where I load the keystore.properties
file (located in project root), which contains:
storeFile=/path/to/my.keystore
storePassword=storepwd
keyPassword=keypwd
keyAlias=keyalias
As you can see, I have a file constructor in the storeFile reference in the gradle.build file and a path to the keystore in the properties file.
Where is the mistake, or what am I missing, not understanding?
Reference
You have to add this DSL in the signing
block not in the buildTypes
block.
signingConfigs {
release {
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
}
}
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