我想为我的应用程序 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.
构建.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
下
关于java - android studio gradle ion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40405742/