Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Self-Destructing Message Android App Sending Messages Adding a File to the Message: Part 2

John Corser
John Corser
5,660 Points

IOUtils error in FileHelper.java after copying in the commons-io-2.4 lib (Android Studio)

I have downloaded the files from the teachers notes and included them, but even after including the .jar in my libs folder, IOUtils fails to import.

Not sure if this helps but have you tried invalidating the cache and restarting?

4 Answers

Bradley St John Jones
Bradley St John Jones
2,286 Points

A quick way to do this is to right click on the new lib file you added and click "add as library" which will be near the bottom.

It cleared everything up for me, including adding dependencies.

Hope that helps anyone else that gets stuck with this problem

In android Studio, press the "sync Gradle files" button that is located next to AVD manager Button.

You know ehat ur talking about man good job buddy

Lisa Steendam
Lisa Steendam
6,825 Points

Your app/build.gradle file should contain a dependencies section that looks like this:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:support-v13:20.0.0'
    compile files('libs/Parse-1.7.1.jar')
    compile files('libs/bolts-android-1.1.3.jar')
    compile files('libs/commons-io-2.4.jar')
}

The commons jar might not be included in yours yet.

Jaroslav Vankat
Jaroslav Vankat
12,054 Points

Hi,

I had the same problem, you just need to upgrade the gradle.build file. Try adding following line of code in dependencies.

compile fileTree(dir: 'libs', include: "commons-io-2.4.jar")