我想为我的应用android使用模块ion(https://github.com/koush/ion#get-ion),但是我无法使用gradle安装该模块。
得到这个错误:
Error:(25, 0) Could not find method compile() for arguments[com.koushikdutta.ion:ion:2.1.9] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
dependencies {
compile 'com.koushikdutta.ion:ion:2.1.9'
}
预先感谢您的回答
您必须将依赖项放在模块gradle中,而不是项目gradle中。
它位于 YourProject/app/build.gradle
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句