Closed tinybright closed 8 years ago
Didn't you set your singingConfig in your build.gradle
?
Here is the code snippet:
signingConfigs {
release {
storeFile file("../keystore/release.keystore")
storePassword "testres"
keyAlias "testres"
keyPassword "testres"
}
debug {
storeFile file("../keystore/debug.keystore")
}
}
signingConfigs {
config1 {
}
}
这个应该是取第一个吧。感觉按名字取不靠谱。
I am getting the same error. The regular release is build correctly which I can upload to the play store. My Gradle file is similar to as suggested at : https://github.com/futurice/android-best-practices#gradle-configuration
signingConfigs {
release {
try {
storeFile FILE_PATH
storePassword KEYSTORE_PASSWORD
keyAlias KEY_ALIAS
keyPassword KEY_PASSWORD
}
catch (ex) {
throw new InvalidUserDataException("You should define KEYSTORE_PASSWORD and KEY_PASSWORD in gradle.properties.")
}
}
}
These variables are stored in gradle.properties
You should remove try catch
Thankyou again for your reply. I tried removing the try catch also. Got the below error on console
:app:generate use7zip = true metaName = META-INF keepRoot = false whiteList = [
.R.drawable.icon, .R.string.com.crashlytics.] compressFilePattern = [.png, .jpg, .jpeg, *.gif, resources.arsc] zipAlignPath = /Users/user_name/Library/Android/sdk/build-tools/23.0.2/zipalign 7zipPath = /usr/local/bin/7za :app:generate FAILED FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:generate'.
Could not find property 'release' on SigningConfig container.
Did you rebuild your project?And can you add your cmdline and build.gradle?
@pranaysharma I guess it cause by the order of variable declare. could you put the andResGuard {...}
at the bottom of your build.gradle
file?
按照你说的修改了还是报这样的错
signingConfigs{
realase{
storeFile file(STORE_FILE)
storePassword STORE_PASSWORD
keyAlias KEY_ALIAS
keyPassword KEY_PASSWORD
try {
storeFile file(STORE_FILE)
storePassword STORE_PASSWORD
keyAlias KEY_ALIAS
keyPassword KEY_PASSWORD
} catch (ex) {
throw new InvalidUserDataException("You should define KEYSTORE_PASSWORD and KEY_PASSWORD in gradle.properties.")
}
}
}
并且 andResGuard放在build.grade最后的
realase -> release
真心太不细心了,就说搞了好久 都不知道 汗
如果项目要打多个渠道包,每个包对应不同的签名,那该如何设置?
使用多productFlavors就可以了,最新版本已经支持了。
On Sun, May 29, 2016 at 10:34 AM, zhuangjiahua notifications@github.com wrote:
如果项目要打多个渠道包,每个包对应不同的签名,那该如何设置?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/shwenzhang/AndResGuard/issues/38#issuecomment-222339302, or mute the thread https://github.com/notifications/unsubscribe/AAbvYkVlf6hDl-ldjkq2t3RHtZCYoDGQks5qGPslgaJpZM4HON__ .
Could not find property 'release' on SigningConfig container.