简体   繁体   中英

How to add Ion to an Android project?

I am trying an example from https://github.com/koush/ion to use Ion for downloading files.

But unfortunately I do not know how should I add Ion to my project. Should I download it to the android studio folder? If so how should I do it? I really appreciate explanation in details.

I am using Android Studio 2.3.3

Build #AI-162.4069837, built on June 6, 2017

JRE: 1.8.0_112-release-b06 amd64

JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

on windows 10 and I can not change it to any newer version.

Please excuse me if my question is trivial, I am very new to Android and Android studio and I would appreciate any help.

You need to add the library in your build.gradle

Gradle

dependencies {
    compile 'com.koushikdutta.ion:ion:(insert latest version)'
}

The instruction below, solved my issue

In build.gradle(module:app) in dependencies add:

compile 'com.koushikdutta.ion:ion:2.1.6

and in build.gradle(project:XXX) where XXX is the name of the project in dependencies add:

classpath 'com.koushikdutta.ion:ion:2.1.6'

Of course I am using a specific version of Android studio with a custom SDK. So my solution might not work for every one!

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