Gradle error when build, failed to calculate
Asked Answered
H

1

7

I debug my app and found this error:

1. Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to calculate the value of task ':app:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.

2. Caused by: org.gradle.api.InvalidUserCodeException: Querying the mapped value of map(java.io.File task ':app:compileDebugJavaWithJavac' property 'annotationProcessorSourcesDirectory' org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@57cd73ff) before task ':app:compileDebugJavaWithJavac' has completed is not supported

Hinojosa answered 29/11, 2022 at 3:33 Comment(1)
Same issue. Full log here: pastebin.com/raw/T3nZexRNPrescience
P
9

Found it!

It is because of the Gradle build version. I had 3.8.0 and it was messing it up, switch to 4.2.0 instead.

In your build.gradle:

  • buildscript-> dependencies-> classpath

Like this:

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.0'
    }
}
Prescience answered 4/1, 2023 at 6:38 Comment(2)
Please do not upload images of code/data/errors.Gallstone
Even with 8.3.1 this error still happens....Curlicue

© 2022 - 2024 — McMap. All rights reserved.