Add commons-io dependency to gradle project in Android Studio

后端 未结 4 1394
滥情空心
滥情空心 2020-12-03 02:21

Very simple question - how to add commons-io dependency to gradle Android project?

I tried the following

buildscript {
    repositories {
           


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-03 03:03

    As of now (May 2014) if you use the default generated project it is actually amazingly simple (though difficult to find instructions!

    Open the second level build.gradle, and add the following line to the dependencies {:

    compile "commons-io:commons-io:+"
    

    That will get the latest version of commons-io. My complete file looks like this:

    apply plugin: 'android'
    
    android {
        compileSdkVersion 19
        buildToolsVersion "19.0.0"
    
        defaultConfig {
            minSdkVersion 18
            targetSdkVersion 19
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                runProguard false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
    }
    
    dependencies {
        compile "commons-io:commons-io:+"
    }
    

提交回复
热议问题