Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 636
Saksham Pruthi Avatar asked Nov 19 '25 13:11

Saksham Pruthi


1 Answers

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"))
    }
}
like image 168
aaronsw Avatar answered Nov 21 '25 01:11

aaronsw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!