我刚刚将我的项目更新为
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:+' }
解决方法
我很确定release {…}应该在buildTypes里面(应该在android里面)不在android中