2015-12-04 2 views
1

Я пытаюсь добавить https://github.com/npgall/concurrent-trees/blob/master/documentation/Downloads.md к моему проекту в файле gradle.Добавлен maven в проект android

buildscript { 
    repositories { 
     mavenLocal() 
     maven { 
      url 'https://oss.sonatype.org/content/repositories/snapshots/' 
     } 
     mavenCentral() 
    } 
    dependencies{ 
     compile group: 'com.googlecode.concurrent-trees', artifactId: 'concurrent-trees', version: '2.4.0' 
     classpath 'com.android.tools.build:gradle:1.5.0' 
     classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0' 
    } 
} 

Я получаю сообщение об ошибке:

Gradle DSL method not found: 'compile()' 

Это для конкретного модуля. Я немного запутался. Что может быть причиной этого?

ответ

1

Похоже, вы добавляете его в свой проект build.gradle. Попробуйте добавить его в зависимости от вашего модуля build.gradle

compile 'com.googlecode.concurrent-trees:concurrent-trees:2.4.0' 

Цитирование docs

Android Studio configures projects to use the Maven Central Repository by default. (This configuration is included in the top-level build file for the project.)

и

In most cases, you only need to edit the build files at the module level.

+0

Спасибо! Есть ли для этого документация? – user3750474

+0

Да, проверьте это: http://developer.android.com/intl/es/tools/building/configuring-gradle.html – random

+0

удивительный. спасибо!!! – user3750474

Смежные вопросы