0

I imported a github module to Android Studio and the build.gradle compile section.

The module is - https://github.com/go-ive/steam-api

Whenever I try to run the application I get this error:

Error: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 adding those two lines and tried numerous of other options but it still doesnt work. Is there something I can add that will make this specific module work? Thank you.

The build.gradle looks like this (Excluding the top):

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.github.go-ive:steam-api:4.2'
    testCompile 'junit:junit:4.12'
}
ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
doamn123
  • 3
  • 2
  • Try targeting Java 7 and recompiling the component. Click [here](http://stackoverflow.com/questions/37902840/got-unsupported-class-file-version-52-0-after-including-a-module-to-a-project) – Austin S Oct 16 '16 at 02:40

1 Answers1

1

I read the project's POM, and it's using Java 8 as both source and target. You can contact the author (perhaps raise a GitHub issue) and ask if Java 7 compatibility is possible, but if the library uses Java 8 features (particularly lambdas, which are very helpful with async networking code), then it may not be practical.

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152