Gradle Error : com.android.build.transform.api.TransformException

3.3k views Asked by At

Error:Execution failed for task ':app:transformClassesWithDependencyCheckerForDebug'.

org.gradle.api.internal.changedetection.rules.DescriptiveChange cannot be cast to org.gradle.api.tasks.incremental.InputFileDetails he may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)

  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
  • In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

    Information:BUILD FAILED

    Information:Total time: 1 mins 21.644 secs Information:1 error

    My build.gradle dependencies:

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        compile 'com.android.support:appcompat-v7:25.1.0'
        compile 'com.android.support:design:25.1.0'
        compile 'com.android.support:support-v4:25.1.0'
        compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
        compile 'com.squareup.retrofit2:retrofit:2.1.0'
        compile 'com.squareup.retrofit2:converter-gson:2.1.0'
        compile 'com.google.code.gson:gson:2.8.0'
        compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
        compile 'uk.co.chrisjenx:calligraphy:2.2.0'
        compile 'org.greenrobot:eventbus:3.0.0'
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'com.google.firebase:firebase-messaging:10.0.1'
        testCompile 'junit:junit:4.12'
    }
    

    ALREADY TRIED:

    This Solution:

    dexOptions {
        javaMaxHeapSize "4g"
        preDexLibraries = false
    }
    

    This Solution:

    multiDexEnabled true
    

    and CLEAN, INVALIDATE and RESTART, all option tried but didn't found any solution.

    Is there any help please?

    2

    There are 2 answers

    0
    Vivek Mishra On

    This happened with me just a few hours ago when I opened an old project after few months. Problem with me was that as I have updated Android Studio after that so gradle plugin too need to be updated. But as soon as I changed gradle version it start giving me this error.

    To solve this, I did following steps

    1. Change your distribution url in gradle-wrapper.properties file.

    distributionUrl=https://services.gradle.org/distributions/gradle-3.2.1-all.zip

    2. Delete caches from your system Users/.gradle folder

    3. Rebuild your project.

    0
    drosanda On

    I'm facing same issue there.

    I deleted the .gradle folder under C:\Users(user-name).gradle

    rerun

    cordova build android
    

    and it worked.

    I dont know it can happened, but I think some files or configuration has corrupted on gradle.