I've been trying to fix this problem for an entire day, and it's probably just something ridiculous. I'm running Android Studio 0.2.5. I needed a library to work on my application (GrepCode internal stuff), so I went and downloaded the jar file and the jar files it depends on. I followed instructions from other SO answers on how to include these dependencies into my project and now I'm getting an error.
1) I first added the jars to the 'libs' folder that I created in the Module
2) I right clicked and hit Add to Library..., named the Library, tried adding it at different levels and still get this error.
3) I went into the Modules section of the settings and made sure that library was selected under the Dependencies tab.
4) I run gradlew clean in the Project directory.
Now at this point, if I don't do step 5 here, I simply get an error saying the packages I'm trying to import don't exist, even though the IDE doesn't SHOW an error when typing out the import statements or the classes from the libraries. Because of this, I tried step 5. According to all the guides, what I did up to this point should have worked.
5) In my build.gradle, the dependencies did not show up, so I typed them out and now this is what my dependency section looks like. If I do not type these out, I just get an error that says the packages don't exist when I try to import them.
dependencies {
compile 'com.android.support:support-v4:13.0.0'
compile files('libs/openjdk-6-b14.jar')
compile files('libs/junit-3.8.1.jar')
compile files('libs/logkit-1.0.1.jar')
compile files('libs/servlet-api-2.3.jar')
compile files('libs/httpcore-4.0.1.jar')
compile files('libs/commons-codec-1.3.jar')
compile files('libs/commons-logging.jar')
compile files('libs/httpclient-4.0.1.jar')
compile files('libs/json-20080701.jar')
compile files('libs/opengl-api-gl1.1-android-2.1_r1.jar')
compile files('libs/xpp3-1.1.4c.jar')
compile files('libs/android-4.2.2_r1.jar')
}
After this I get an error in the message box saying "Gradle: Execution failed for task ':SendPicTest:dexDebug'."
And in the idea.log I find this error: "java.lang.OutOfMemoryError: GC overhead limit exceeded"
So, I believe Step 5 is unnecessary, but I'm not sure. I've tried many different ways of importing these libraries and NOTHING has worked...I'm completed lost...anybody have any ideas? Thanks!