0

I am trying to setup a JDBC jar for my android studio project. I am currently getting an error when trying to launch the application due to the Module/Dependency I added.

Stack Trace

Error:Gradle: Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add 
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.

I tried following the steps in the trace and modifying the build.gradle file but could not resolve the issue. I am not sure if I need to uninstall and reinstall the module and set the compiler to 1.7 in the process or if I can even do that.

Brenton
  • 264
  • 1
  • 2
  • 10

1 Answers1

1

To get it to work you'll need a Java 7 compiled jar. See: Is it possible to use Java 8 for Android development?.

Additionally not sure why you are trying to include a JDBC driver into Android app, but recommend reading this: JDBC vs Web Service for Android

Community
  • 1
  • 1
Morrison Chang
  • 11,691
  • 3
  • 41
  • 77