0
votes

I'm running into this error building gradle:

org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection Possible causes for this unexpected error include:

  • Gradle's dependency cache 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.

build.grandle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"

    defaultConfig {
        applicationId "com.google.android.gms.samples.vision.face.facetracker"
        minSdkVersion 19
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.google.android.gms:play-services-vision:9.4.0+'
    compile 'org.apache.commons:commons-math3:3.6.1'
    compile 'com.edwardraff:JSAT:0.0.9'
}

grandle-wrapper.properties:

#Sun Sep 02 12:44:30 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip

HOw could I fix it?

1
Did you try all suggestions from gradle exception stack trace?Try to Invalidate caches/ Restart...Oleg Sokolov
Given suggestions are clear, please try them firstly.navylover
I've tried all suggestion. Building grandle files anyway and show me the same errors.DoctorWho
What happens when you follow the suggestions given in the error message?Code-Apprentice
@Code-Apprentice start building and it stop again showing the same messagesDoctorWho

1 Answers

0
votes

I don't know if this will work or not but replace "compile" with "implementation". Check this out: What's the difference between implementation and compile in Gradle?