我正在申请中实施材料设计。 我收到错误“错误:(2,0)无法在项目':app'上找到属性'release'。”在建立我的gradle时
这是我的gradle代码:
apply plugin: 'com.android.application'
name=release
storeFile=null
storePassword=null
keyAlias=null
keyPassword=null
storeType=null
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.rey.material.demo"
minSdkVersion 9
targetSdkVersion 21
versionCode 5
versionName "0.0.5"
}
signingConfigs {
release {
storeFile file(MATERIAL_KEYSTORE_FILE)
storePassword MATERIAL_KEYSTORE_PASSWORD
keyAlias MATERIAL_KEYSTORE_ALIAS
keyPassword MATERIAL_KEYSTORE_PASSWORD
}
}
buildTypes {
release{
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
compile project(':lib')
}
请帮帮我, 谢谢。
答案 0 :(得分:2)
您实际上不需要以下代码
name=release
storeFile=null
storePassword=null
keyAlias=null
keyPassword=null
storeType=null
删除这些行并再次检查! 它应该现在看起来像这样
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.rey.material.demo"
minSdkVersion 9
targetSdkVersion 21
versionCode 5
versionName "0.0.5"
}
signingConfigs {
release {
storeFile file('MATERIAL_KEYSTORE_FILE_Path')
storePassword 'password'
keyAlias 'keyAliasName'
keyPassword 'MATERIAL_KEYSTORE_PASSWORD'
}
}
buildTypes {
release{
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
compile project(':lib')
}