I was having same issue then realized that the version of commons-io getting picked up was lower than what I need (2.4)....I need to Override the already managed version as below to get the right one picked up:
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
Answer from puppyDomminatedWorld on Stack OverflowI was having same issue then realized that the version of commons-io getting picked up was lower than what I need (2.4)....I need to Override the already managed version as below to get the right one picked up:
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
I also faced the same issue, but after adding dependency in pom error got removed.
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
you can also refer URL http://zetcode.com/java/fileutils/
it started working now. I downloaded commons-io-2.4 from a different resource and imported to my project. Thanks
I had the same issue, solved by adding 'commons-io:commons-io:2.4' to dependencies in build.gradle:
dependencies {
testImplementation (
'commons-io:commons-io:2.4'
)
}
if you are using target sdk as 23 add below code in your build.gradle
android{
compileSdkVersion 23
buildToolsVersion '23.0.1'
useLibrary 'org.apache.http.legacy'
}
and change your buildscript to
classpath 'com.android.tools.build:gradle:1.3.0'
for more info follow this link
I had this problem and then found these pages: Here you can see that apache library is deprecated, but it's not removed, so it should work. It doesn't.
See.
And here you can see how to include apache library to your project
See.
I resolved problem by adding following to my build.gradle file as recommended in second link.
android {
useLibrary 'org.apache.http.legacy'
}
However this only works if you are using gradle 1.3.0-beta2 or greater, so you will have to add this to buildscript dependencies if you are on a lower version:
classpath 'com.android.tools.build:gradle:1.3.0-beta2'
Try running the following commands and examine the output:
$ mvn dependency:tree
$ mvn help:effective-pom
Look for commons-lang, maybe something will draw your attention like excludes or dependency overrides. Also, is:
$ mvn dependency:copy-dependencies
copying commons-lang JAR to your target?
Adding following dependency to pom.xml in dependencies tag helped me:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>