I got an email from Google asking me to update Fit Cat for Android Wear 2.0, so I tried to compile that after I haven’t touched it for a few .

Since Studio evolves so quickly, I wasn’t exactly surprised when I got an 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  8 or above.

It asked me to add sourceCompatitbility and targetCompatitbility to Java submodules. What does that mean? After a lot of searching plus trial and error I found the answer.

In your top-level build.gradle, add this:

allprojects {
  tasks.withType(JavaCompile) {
    sourceCompatibility = JavaVersion.VERSION_1_7
    targetCompatibility = JavaVersion.VERSION_1_7
  }
}



Source link
thanks you RSS link
( http://feedproxy.google.com/~r/sqisland/~3/EM-q-OBsbEg/java--in-gradle.html)

LEAVE A REPLY

Please enter your comment!
Please enter your name here