question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot change attributes of dependency configuration ':my-module:releaseUnitTestCompileClasspath' after it has been resolved

See original GitHub issue

Hi, I am trying to import Paparazzi in a module, however, I’m not able to build after adding Paparazzi gradle plugin.

Cannot change attributes of dependency configuration ':my-module:releaseUnitTestCompileClasspath' after it has been resolved

A problem occurred configuring project ':my-module'.
> Failed to notify project evaluation listener.
   > java.lang.IllegalArgumentException: Cannot change attributes of dependency configuration ':fmy-module:releaseUnitTestCompileClasspath' after it has been resolved
   > KotlinJvmAndroidCompilation with name 'releaseUnitTest' not found.



Is this an issue with the plugin, or am I missing sth? Thanks!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

26reactions
JakeWhartoncommented, May 10, 2022

The US Supreme Court is set to overturn Roe v. Wade according to a leaked ruling draft despite an overwhelming support for it by the public.

The son of the dictator who ruled the Philippines for 14 years under martial law is set to become the next president.

Pfizer and Moderna are developing Omicron-specific vaccines as cases continue to rise globally.

4reactions
morrisseyaicommented, Aug 11, 2022

Posting advice in case anyone else comes across this:

This is not a Paparazzi issue, but adding the Paparazzi plugin can surface an existing issue with your build script.

A few years ago the Gradle Tasks API changed in a way that meant many projects could update to newer versions of Gradle and not see any issue… it was a very forgiving API change, in that many users would see no difference and things continued to work as expected, despite their project now using an outdated and no-longer-recommended API.

If you’re working on an older codebase, or a codebase that copied its tasks.withType(Test) code from an older project and never updated to the new Tasks API, adding Paparazzi will surface this problem.

TL;DR: Update your Test configuration tasks to use configureEach.

Before:

tasks.withType(Test) {
    // config
}

After:

tasks.withType<Test>().configureEach {
    // config
}

cc: @sherviiin @robertpicsart @eboudrant @MarinaShaposhnikova

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot change attributes of dependency configuration ':app ...
I had the same issue. It was this code: project.tasks.withType(Test::class.java) { useJUnitPlatform() testLogging { setEvents(setOf("passed" ...
Read more >
Cannot change attributes of configuration ':android:kapt' after it ...
Issue details sync failed with Cannot change attributes of configuration ':android:kapt' after it has been resolved message.
Read more >
Weird error when trying to add dependency "Cannot change ...
When I try to compile my project with a dependency, it refused to compile with ... "Cannot change configuration after it has been...
Read more >
Cannot change dependencies of configuration *** after it has ...
Android compile error: Cannot change dependencies of configuration *** after it has been included in dependency resolution.
Read more >
4. Dependency Management - Gradle Beyond the Basics [Book]
Different kinds of dependencies are resolved into files in different ways. While this is the fundamental role of configurations, they also provide methods ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found