Monits / static-code-analysis-plugin

A plugin to simplify Static Code Analysis on Gradle. Not restricted to, but specially useful, in Android projects, by making sure all analysis can access the SDK classes.
Apache License 2.0
39 stars 12 forks source link

InvalidUserDataException: Cannot change role of configuration XXX after it has been included in dependency resolution #35

Closed barriosnahuel closed 5 years ago

barriosnahuel commented 5 years ago

Hi!

I faced this error when running ./gradlew check

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Cannot change role of configuration ':app:debugApk' after it has been included in dependency resolution.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

which going deeper is:

Encountered an error trying to set inputs and outputs for Android Lint tasks, it will be disabled. Please, report this incident at https://github.com/monits/static-code-analysis-plugin/issues

...

InvalidUserDataException: Cannot change role of configuration ':module:debugPublish' after it has been included in dependency resolution

after an upgrade from: classpath 'com.android.tools.build:gradle:3.4.2' to v3.5.0

See the output.log

Context:

jsotuyod commented 5 years ago

Thanks Nahuel. AGP 3.5 is currently unsupported, work to support it in the upcoming 2.6.11 release is in progress.

jsotuyod commented 5 years ago

@barriosnahuel 2.6.11 is out with AGP 3.5.0 support.

Bare in mind, with AGP 3.5.0 lint tasks can no longer be up to date, due to a bug in AGP itself:

https://issuetracker.google.com/issues/141126614

The full changelog is available here