简体   繁体   中英

android studio gradle ion

I would like use the module ion ( https://github.com/koush/ion#get-ion ) for my app android but I can't install this module with gradle.

Got this error :

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'
}

Thank you in advance for the answer

You have to put the dependency in the module gradle and not in the project gradle.

It's located under YourProject/app/build.gradle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM