2014-10-07 51 views
0

出於某種原因,我無法導入針對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() 
    } 
} 

回答

1

在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