At the compile time Error:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException:
com.android.builder.dexing.DexArchiveBuilderException:
com.android.builder.dexing.DexArchiveBuilderException:
Failed to process
C:\Users\IMRAN\.gradle\caches\transforms-1\files-1.1\exoplayer-core-2.9.0.aar\b67c50a36d1f5756f1ae8b00f1a749a8\jars\classes.jar
Package.json:
"dependencies": {
"prop-types": "^15.6.2",
"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.4",
"react-native-grid-component": "^1.1.0",
"react-native-indicators": "^0.13.0",
"react-native-tab-view": "^1.2.0",
"react-native-track-player": "^1.0.0",
"react-navigation": "^2.18.2"
},
"devDependencies": {
"@babel/runtime": "^7.1.2",
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.49.0",
"react-test-renderer": "16.6.0-alpha.8af6728"
},
"jest": {
"preset": "react-native"
}
android/build.gradle:
buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
I also had the same issue on new project, then I added
android {
....
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
.....
into android/app/build.gradle and the issue is gone.
I also had the same issue on new project, then I added
android { .... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } .....into
android/app/build.gradleand the issue is gone.
Thanks Mate , After 5 Days my project complied with no error. And By the way it was written in installation of latest version and my mistake is to write in android/build.gradle and it generate error and then i am trying without using it.
Happy Coding.....
I also had the same issue on new project, then I added
android { .... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } .....into
android/app/build.gradleand the issue is gone.
Thank you!!
Same problem, but this isn't resolving it. Even after a gradew clean in android, running it always gives the same error:
Most helpful comment
I also had the same issue on new project, then I added
into
android/app/build.gradleand the issue is gone.