android gradle 0.8到0.9 ==>找不到支持的Gradle DSL方法:'release()'

时间:2014-03-13 19:18:14

标签: android android-studio android-gradle

我已将Android Studio从 4.6 更新为 5.1

现在,Gradle插件也从 0.8 更新为 0.9

现在我得到了很多其他用户的错误。我在stackoverflow中阅读了很多,但没有找到任何帮助我解决问题的解决方案。

我有这个错误:

 Build script error, unsupported Gradle DSL method found: 'release()'!
 Possible causes could be:  
 - you are using Gradle version where the method is absent 
 - you didn't apply Gradle plugin which provides the method
 - or there is a mistake in a build script

这是我的build.gradle:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.0.3'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
    }
    signingConfigs {
        release {
        storeFile file("XXXX")
        storePassword "XXXX"
        keyAlias "XXXX"
        keyPassword "XXXX"
        }
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            signingConfig signingConfigs.release
        }
    }
}

dependencies {
    compile project(':main')
    compile 'com.google.android.gms:play-services:4.2.42'
    compile 'com.android.support:support-v4:19.0.+'
    compile 'com.google.code.gson:gson:2.2.+'
}

我的目录https://stackoverflow.com/a/22247337/2876645

中也有此文件

此外,我没有发现build.gradle与this之间存在真正的区别。

0 个答案:

没有答案