Saksham Pruthi
Saksham Pruthi

Reputation: 424

Cannot change attributes of dependency configuration ':app:releaseUnitTestCompileClasspath' after it has been resolved

I upgraded my gradle from 7.0.4 to 7.2.1 on prompt from android studio. Android Studio ran upgrade assisstant to upgrade the gradle and immediately after it began gradle sync and after that I get the

Cannot change attributes of dependency configuration ':app:releaseUnitTestCompileClasspath'after it has been resolved

enter image description here

This is what my build window shows enter image description here

I am unable to figure out this error. What does ':app:releaseUnitTestCompileClasspath' means?

Upvotes: 3

Views: 2045

Answers (1)

Niels
Niels

Reputation: 9384

I had the same issue. It was this code:

project.tasks.withType(Test::class.java) {
    useJUnitPlatform()
    testLogging {
        setEvents(setOf("passed", "skipped", "failed"))
    }
}

I replace it with this:

project.tasks.withType(Test::class.java).configureEach {
    useJUnitPlatform()
    testLogging {
        setEvents(setOf("passed", "skipped", "failed"))
    }
}

Upvotes: 6

Related Questions