找不到参数的方法release()

时间:2014-03-05 21:13:55

标签: android gradle facebook-android-sdk

我刚刚将我的项目更新为Android Gradle插件0.9.0,我在尝试运行项目时出现以下错误:

FAILURE: Build failed with an exception.

* Where:                    
Build file 'C:\...\facebookSDK\build.gradle' line: 12

* What went wrong:          
A problem occurred evaluating project ':facebookSDK'.
> Could not find method release() for arguments [build_3ug2bdgu6mi6jljp3krac916n3$_run_closure1_closure4@e1bf3ff] on project ':facebookSDK'.

* Try:                      
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

我只在我的一个项目中遇到此错误。如果我切换回0.8。+它工作正常。

这是facebookSDK模块的gradle.build文件。

apply plugin: 'android-library'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 8
    }

    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile 'com.android.support:support-v4:+'
}

1 个答案:

答案 0 :(得分:11)

我非常确定release { ... }应位于buildTypes内(应位于android内)而不是android