1
我已审查了一些关于这个话题的帖子的方法storeFile(),摇篮错误 - 找不到参数/路径/到/ storefile
为首发。但我还是不能让过去的摇篮错误Error:(69, 0) Could not find method storeFile() for arguments [/path/to/my.keystore]
在线69:
storeFile file(keystoreProperties['storeFile'])
在模块gradle这个build文件 - 我的模块gradle.build文件的内容:
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']
}
...
}
...
}
...
,我加载keystore.properties
文件(位于项目的根目录),其中包含:
storeFile=/path/to/my.keystore
storePassword=storepwd
keyPassword=keypwd
keyAlias=keyalias
正如你所看到的,我已经在gradle.build文件storeFile参考文件构造和属性文件中密钥库的路径。
哪里是错误,或者我错过了什么,不理解?
参考
- 的Android 2.3.3工作室
- 摇篮4.1版