当我想将新库添加到 build.gradle 文件时,它会生成错误。 这是我的 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:1.0.0'
compile 'com.mcxiaoke.volley:library:1.0.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
这就是错误
C:\Users\Fakher\Documents\Play_Store_WS\VolleyJson\build.gradle Error:Error:line (10)Gradle DSL method not found: 'compile()' Possible causes:
The project 'VolleyJson' may be using a version of Gradle that does not contain the method. Gradle settings The build file may be missing a Gradle plugin. Apply Gradle plugin
最佳答案
您需要使用模块的build.gradle而不是您的项目。
关于android - 在Android Studio中添加依赖项时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29778390/