1

I have tried to include adColony.jar file into my libs folder. I can initiate the SKD okay. But when I try to compile the app, I get an error:

Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

If I delete the adColony.jar, it compiles fine.

Any advice? Thank you

Logan Wayne
  • 6,001
  • 16
  • 31
  • 49
Thiago
  • 12,778
  • 14
  • 93
  • 110

2 Answers2

3

You can add *.jar file using Android studio.

In the project right click

-> new -> module
-> import jar/AAR package
-> import select the jar file to import
-> click ok -> done

See the screenshots here

Community
  • 1
  • 1
Ganesh Pandey
  • 5,216
  • 1
  • 33
  • 39
0

Let me be a bit more precise here. You have to:

  1. Copy the .jar file into the /libs folder of your Android Studio project (usually something like /ProjectName/app/libs)
  2. Switch to Android Studio and select the Project perspective

Android Studio Project perspective

  1. Right-click the .jar from the libs folder and chose "Add as library..." (last option)

Voila! You can now use all classes from the .jar file.

Richard R
  • 873
  • 6
  • 20