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.
Solution:
A: There is a dependency package conflict; (find and delete; in general, if there are both in the main project and the dependent project; discard the one in the main project.)
B: Try to clean the project;
C.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
android { defaultConfig { ... jackOptions { enabled true } } dexOptions { incremental true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } |
Similar Posts:
- Android Project Error: Invoke-customs are only supported starting with Android O (–min-api 26)
- [Solved] com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
- [Solved] com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
- How to Solve IDEA Error: “Library source does not match the bytecode for class”
- Flutter: Android dependency ‘com.android.support:support-v4’ has different version …
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- Could not find com.android.tools.build:gradle:3.3.0.
- [Solved] Android Warning: Gradle DSL method not found: ‘android()’
- [Solved] Gradle Error: Could not find method api() for arguments….
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler