Hi folks, anyone have an idea why I might get this...
# detekt
t
Hi folks, anyone have an idea why I might get this error when running the
detekt
gradle task on a mixed project with both kotlin-only and kotlin + android modules?
Copy code
Execution failed for task ':rxreactor1:detekt'.
> Could not resolve all files for configuration ':rxreactor1:detekt'.
   > Could not find io.gitlab.arturbosch.detekt:detekt-cli:provider(?).
     Searched in the following locations:
       - <https://dl.google.com/dl/android/maven2/io/gitlab/arturbosch/detekt/detekt-cli/provider(?)/detekt-cli-provider(?).pom>
       - <https://repo.maven.apache.org/maven2/io/gitlab/arturbosch/detekt/detekt-cli/provider(?)/detekt-cli-provider(?).pom>
     Required by:
         project :rxreactor1
I’m in the process of switching to version catalogs, and Gradle 8, so either of those two could cause an issue.
b
That
(?)
seems really strange. It feels like gradle doesn't know which version should get.
g
It might be that there is another Gradle plugin that uses
version.properties
and is messing up with ours? 🤔
Could you open an issue and provide the list of all the Gradle plugins you add?
t
Sure thing, I’ll do that. Thanks Nicola.
Looking more closely, I might not be able to upgrade to AGP 8, since it requires Gradle 8.x, and Kotlin 1.8.20 only supports max to Gradle 7.6.0
@gammax Figured it out… I had
toolVersion = libs.versions.detekt
which was causing the issue. Commenting it out, everything seems to run fine.
Might be needed because I had this as a dependency:
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$libs.versions.detekt"
g
mmmm
suspicious
t
so I updated the dependency to this:
Copy code
dependencies {
        detektPlugins libs.detekt.formatting
    }
And everything works! Not sure why the string dependency with template was causing issues
Oddly, now I’m getting the same kind of error for jacoco, where I’m also setting a toolVersion. Something to do with version catalogs I guess
a
Shouldn't it be
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:${libs.versions.detekt*.get()}*"
140 Views