添加的commons-io的依赖于Android中的gradle工作室项目 [英] Add commons-io dependency to gradle project in Android Studio

查看:2124
本文介绍了添加的commons-io的依赖于Android中的gradle工作室项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很简单的问题 - 如何添加的的commons-io的的依赖于摇篮Android项目

我尝试以下

  buildscript {
库{
    mavenCentral()
}
依赖{
    类路径'com.android.tools.build:gradle:0.5.+
}
}
应用插件:'机器人'依赖{
    编译文件(库/ Android的支持 - v4.jar')    编译组:公地IO,名称:公地IO,版本:2.0.1
}

,但它不工作
该错误是

摇篮:一个问题发生配置工程:LearnIt。


  

未能通知项目评估监听器。
  无法解析配置所有的依赖:LearnIt:_DebugCompile。
        >找不到公共-IO:公地IO:2.0.1
          要求:
              learnit:LearnIt:未指定



解决方案

您需要要解决的(例如MavenCentral)公地IO库来声明一个存储库:

  buildscript {
    库{
        mavenCentral()
    }    依赖{
        类路径'com.android.tools.build:gradle:0.5.+
    }
}应用插件:'机器人'库{
    mavenCentral()
}依赖{
    编译文件(库/ Android的支持 - v4.jar')    编译组:公地IO,名称:公地IO,版本:2.0.1
}

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

I tried the following

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'

dependencies {
    compile files('libs/android-support-v4.jar')

    compile group: 'commons-io', name: 'commons-io', version: '2.0.1'
}

but it does not work The error is

Gradle: A problem occurred configuring project ':LearnIt'.

Failed to notify project evaluation listener. Could not resolve all dependencies for configuration ':LearnIt:_DebugCompile'. > Could not find commons-io:commons-io:2.0.1. Required by: learnit:LearnIt:unspecified

解决方案

you need to declare a repository where you want to resolve the commons-io library from (e.g. MavenCentral):

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.5.+'
    }
}

apply plugin: 'android'

repositories{
    mavenCentral()
}

dependencies {
    compile files('libs/android-support-v4.jar')

    compile group: 'commons-io', name: 'commons-io', version: '2.0.1'
}    

这篇关于添加的commons-io的依赖于Android中的gradle工作室项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆