与进口抽射Android Studio中

问题描述:

出于某种原因,我无法导入针对Android工作室凌空插件的问题,我收到以下错误:与进口抽射Android Studio中

Error:(9, 0) Build script error, unsupported Gradle DSL method found: 'compile()'! 

Possible causes could be: 
    - you are using Gradle version where the method is absent (<a href="open_gradle_settings">Fix Gradle settings</a>) 
    - you didn't apply Gradle plugin which provides the method (<a href="apply_gradle_plugin">Apply Gradle plugin</a>) 
    - or there is a mistake in a build script (<a href="goto_source">Goto source</a>) 

,这里是我的build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:0.12.2' 
     compile 'com.mcxiaoke.volley:library:1.0.6' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

在build文件注释:

// NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 

意味着你不应该把这些相关性语句在此文件中。它们属于模块目录中的build.gradle文件。

+0

模块是否在哪里? – anuraagy 2014-10-07 23:06:33

+0

这是您的应用程序模块文件所在的项目根目录下的目录。 – 2014-10-07 23:14:44