title: Android Studio preDexDebug error when compiling MySQL Connector Jar file
body: <p>Trying to connect to a MySQL database in Android Studio 1.4.1. Placed MySQL Connector JAR file in libs directory and added it as library by doing a <em>compile files('libs/mysql.jar')</em>. </p>
  
  <p>When I try run the app I get the following error:</p>
  
  <pre><code>:app:preDexDebug
  UNEXPECTED TOP-LEVEL EXCEPTION:
  java.lang.RuntimeException: Exception parsing classes
  at com.android.dx.command.dexer.Main.processClass(Main.java:752)
  at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
  at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
  at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
  at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
  at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
  at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
  at com.android.dx.command.dexer.Main.processOne(Main.java:672)
  at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
  at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
  at com.android.dx.command.dexer.Main.run(Main.java:277)
  at com.android.dx.command.dexer.Main.main(Main.java:245)
  at com.android.dx.command.Main.main(Main.java:106)
  
  Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
  at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
  at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
  at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
  at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
  at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
  at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
  at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
  at com.android.dx.command.dexer.Main.processClass(Main.java:749)
  ... 12 more
  1 error; aborting
  Error:Execution failed for task ':app:preDexDebug'.
  &gt; com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: 
      Process 'command 'C:\Program Files\Java\jdk1.8.0_74\bin\java.exe'' finished with non-zero exit value 1
  </code></pre>
  
  <p>Here's my build.gradle:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.2"
  
      defaultConfig {
          applicationId "com.example.breandan.dishfinder"
          minSdkVersion 16
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.1.1'
      compile 'com.android.support:design:23.1.1'
      compile files('libs/mysql.jar')
  }
  </code></pre>
  
  <p>When I remove the <em>compile files('libs/mysql.jar')</em> line, the code runs but it doesn't do any of my database code.</p>