我想在我的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

关于java - Android Studio Gradle ionic ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40405742/

10-11 22:21
查看更多