I have an Android application project (A) and an Android library project (L). A uses L as a library.
L, the library project, uses a few external libraries already: Apache Commons Codec 1.7, Apache Commons Lang3 3.1, the Android Support library V4, and ActionBarSherlock 4.0, referenced as a library project. All of these libraries, and the code that calls them, work perfectly fine, and have been working fine for a while.
However, I recently added one more library: Apache Commons IO 2.4. Now my application crashes any time the library code (in L) tries to call a method in Commons IO.
I've added the IO library in exactly the same way as I've added every other external library:
When my application first starts I get:
11-01 12:32:14.243: I/dalvikvm(3815): Could not find method org.apache.commons.io.FileUtils.copyInputStreamToFile, referenced from method au.com.grdc.alib.helpers.LibraryCommon.download
11-01 12:32:14.243: W/dalvikvm(3815): VFY: unable to resolve static method 7039: Lorg/apache/commons/io/FileUtils;.copyInputStreamToFile (Ljava/io/InputStream;Ljava/io/File;)V
Later on I get:
11-01 14:50:48.913: E/AndroidRuntime(10030): FATAL EXCEPTION: AsyncTask #1
11-01 14:50:48.913: E/AndroidRuntime(10030): java.lang.RuntimeException: An error occured while executing doInBackground()
...
11-01 12:35:10.268: E/AndroidRuntime(4493): Caused by: java.lang.NoClassDefFoundError: org.apache.commons.io.FileUtils
11-01 12:35:10.268: E/AndroidRuntime(4493): at au.com.grdc.alib.helpers.LibraryCommon.download(LibraryCommon.java:89)
I saw that it was recommended to rename my "lib" folder to "libs", which I've done — this hasn't fixed the problem.
I also saw recommendations to mark external libraries to be exported, which I've also done, and which also hasn't fixed the problem.