React-native-track-player: Compile time error of react-native-track-player v 1.0.0 with react-native v 0.57.1 to v 0.57.4

Created on 5 Nov 2018  路  4Comments  路  Source: react-native-kit/react-native-track-player

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")
}

Most helpful comment

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.

All 4 comments

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.gradle and 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.gradle and 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:

  • What went wrong:
    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\main.gradle\caches\transforms-1\files-1.1\jetified-exoplayer-core-2.10.1.aar\fad0a1e268d35474fa0d356d34f6ca05\jars\classes.jar
Was this page helpful?
0 / 5 - 0 ratings