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!
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
Ziga Klemencic
2,569 PointsError in FileHelper.java
I keep getting this error in fileHelper uploaded on GitHub by Ben. and cant find a way to solve it...
error i get is here `` else { try { File file = new File(uri.getPath()); FileInputStream fileInput = new FileInputStream(file); fileBytes = IOUtils.toByteArray(fileInput); } catch (IOException e) { Log.e(TAG, e.getMessage());
`` i get error here : fileBytes = IOUtils.toByteArray(fileInput);
IOUtils cannot be resolved
Help would be apriciated :D
Thanks for your time :D
6 Answers

Timothy Boland
18,237 PointsI had the same problem in Android Studio....When I copied the file over, AS was importing from:
import com.google.android.gms.internal.io.IOUtils;
after changing to:
import org.apache.commons.io.IOUtils;
the error went away :-)

Ben Jakuben
Treehouse TeacherYou need the Apache Commons IO jar. See the Teacher Notes and the 2:55 mark in this video

Ziga Klemencic
2,569 PointsI have downloaded and copied into libs directory commons-io-2.4.jar file but i still have error there.

Ziga Klemencic
2,569 Pointsok i found the problem. thanks for your time ben :D

Ben Jakuben
Treehouse TeacherGreat - glad you got it working! If you have a minute, what was the issue? Might help other students in the future.

Ziga Klemencic
2,569 PointsActualy i dont' know it just sudenley started working right, i had to reset eclipse and computer but then it worked, i guess there was a problem when i coppied Apache commons IO.jar and needed to reset the computer :D

Gilad Solter
2,986 PointsI'm having the same problem, but restarting Android Studio and my computer didn't do the trick.... Any thoughts?

Ben Jakuben
Treehouse TeacherHi Gilad, if you're still having trouble, can you post a new thread in the Forum and paste in details from your build.gradle file?