2014-10-07 2 views
0

По некоторым причинам я не могу импортировать плагин залпа для андроид студии, я получаю следующее сообщение об ошибке:Проблемы с Импорт Volley для Android Студия

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

Этот комментарий в файле сборки:

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

означает, что вы не должны ставить эти утверждения зависимостей в этом файле. Они принадлежат файлу build.gradle, который находится в вашем каталоге модулей.

+0

Где находится модуль diectory? – anuraagy

+0

Это каталог под вашим корнем проекта, где находятся файлы вашего приложения. –