1

In android studio i'm trying to add a mysql connector library for my app. after pasting the jar into the lib folder and ensuring that it was listed to compile in build.gradle. I click run app and get this error before it even asks for an emulator to run on:

Error:Execution failed for task ':app:preDexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1

If I delete the jar I pasted in then this error disappears.

my dependencies

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile files('libs/mysql-connector-java-5.1.37-bin.jar')
}
Jack
  • 391
  • 5
  • 25
  • 2
    Possible duplicate of [Android Studio unable to resolve error ':app:preDexDebug'](http://stackoverflow.com/questions/28933701/android-studio-unable-to-resolve-error-apppredexdebug) – Dhinakaran Thennarasu Oct 30 '15 at 02:29
  • Have you looked at this post: http://stackoverflow.com/questions/16608135/android-studio-add-jar-as-library?answertab=oldest#tab-top – T D Nguyen Oct 30 '15 at 04:49
  • @NguyenDoanTung I've done everything in that post, i added the dependencies code to my question. Thought it might be the first line so i tried removing the compile filetree then tried removing the compile files instead both times I get the same error – Jack Oct 30 '15 at 14:01

1 Answers1

1

Current Android dex compiler cannot recognize mysql-connector-java-5.1.37-bin.jar or later because they are compiled for Java1.8.

see: android JDBC mysql java connector app:preDexDebug

Community
  • 1
  • 1