I already read this article and all other related: Android: Dex cannot parse version 52 byte code
But still I have next issue while doing build:
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.
Android Studio 3.0.1
classpath 'com.android.tools.build:gradle:2.3.3'
buildToolsVersion '26.0.2'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion 26
buildToolsVersion '26.0.2'
When I do: gradlew installDebug - it installs application to device. But when I start application from Run/Debug - it fails with this error. I am using Java SDK 1.8 and JAVA_HOME path is defined to C:\Program Files\Java\jdk1.8.0_151.
Does any one know how to fix this? Thanks.