0

I am facing this error since i have updated my android studio to 2.2.1.

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.

So far i have tried:

  1. cleaning and building the project
  2. adding " sourceCompatibility = "1.7" targetCompatibility = "1.7" " to the gradle file.

Can anyone suggest how to solve this problem.

Shahrukh Haider
  • 454
  • 2
  • 16

1 Answers1

1

You should use JDK 1.8.0_92

You are getting

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.

Then you can set below in your gradle section .

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

Clean-Rebuild. Hope this helps you .

For better answer you can visit Android: Dex cannot parse version 52 byte code

Community
  • 1
  • 1
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
  • Hi,I cannot able to resolve same kind of exception.Please check https://stackoverflow.com/questions/51720018/obfuscation-minifyenabled-true-not-working-in-debug-and-release – Naveen Aug 08 '18 at 09:32