我尝试像这个链接所示的方式对我的应用进行签名。 我编写了我的 signingConfigs 设置,但是出现了“找不到属性”错误。
这是我的 build.gradle 文件。
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
defaultConfig {
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "Andy Warhol"
}
buildTypes {
debug {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
debuggable false
jniDebugBuild false
signingConfig signingConfigs.myconfig
}
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
debuggable false
jniDebugBuild false
}
}
signingConfigs {
myconfig {
keyAlias 'xxx'
keyPassword 'xxx'
storeFile file('xxx')
storePassword 'xxx'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:4.0.30'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/picasso-2.2.0.jar')
compile files('libs/acra-4.5.0.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
}
这是我的错误
Gradle 'BulentTirasMobileApp' 项目刷新失败: 在 SigningConfig 容器中找不到 'myconfig' 属性。