ignoreKtx(true) is not working
Plugin version 2.1.4
Gradle version 8.10.2
JDK version 23
(Optional) Kotlin and Kotlin Gradle Plugin (KGP) version 2.0.20
(Optional) Android Gradle Plugin (AGP) version 8.6.2
(Optional) reason output for bugs relating to incorrect advice
./gradlew sha:vide:reason --id androidx.lifecycle:lifecycle-runtime:2.8.6
:shared:video-player
\--- io.coil-kt:coil-base:2.7.0
\--- androidx.lifecycle:lifecycle-runtime:2.8.6
Source: developDebug, main
--------------------------
(no usages)
./gradlew sha:vide:reason --id libs.androidx.lifecycle.runtime
Shortest path from :shared:video-player to androidx.lifecycle:lifecycle-runtime-ktx:2.8.6 (libs.androidx.lifecycle.runtime) for nowsecureReleaseUnitTestRuntimeClasspath:
:shared:video-player
\--- androidx.lifecycle:lifecycle-runtime-ktx:2.8.6
Source: developDebug, main
--------------------------
(no usages)
Describe the bug The ktx dependency is proposed to be removed and the normal dependency is proposed to be added even we have
dependencyAnalysis {
structure {
ignoreKtx(true) // default is false
}
}
In the root folder.
Expected behavior
ignoreKtx is respected
Additional context
Plugin is applied in root folder and then applied in every module. The ignoreKts is applied in the root file.
Thanks for the issue. Do you have a reproducer?
Sorry for the delay, let me try in small project.
Having the same issue with these three
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7")
implementation("androidx.paging:paging-common-ktx:3.3.6")
Plugin version 2.16.0
Gradle version 8.13
JDK version 23 (for Gradle), 17 (for code generation)
(Optional) Kotlin and Kotlin Gradle Plugin (KGP) version 2.1.10
(Optional) Android Gradle Plugin (AGP) version 8.9.1
(Optional) reason output for bugs relating to incorrect advice
All these 3 dependencies are directly declared in the build.gradle.kts file.
When I ask why adding the others are suggested I get this:
------------------------------------------------------------
You asked about the dependency 'androidx.lifecycle:lifecycle-runtime:2.8.7'.
You have been advised to add this dependency to 'implementation'.
It matched a bundle rule: androidx.lifecycle:lifecycle-runtime:2.8.7 was substituted for androidx.lifecycle:lifecycle-runtime-android:2.8.7.
------------------------------------------------------------
Shortest path from :myproject to androidx.lifecycle:lifecycle-runtime:2.8.7 for myflavorDebugCompileClasspath:
:myproject
\--- com.google.android.material:material:1.12.0
\--- androidx.lifecycle:lifecycle-runtime:2.8.7
Shortest path from :myproject to androidx.lifecycle:lifecycle-runtime:2.8.7 for myflavorDebugRuntimeClasspath:
:myproject
\--- androidx.lifecycle:lifecycle-extensions:2.2.0
\--- androidx.lifecycle:lifecycle-runtime:2.8.7
(ditto for other flavors)
Similar for the others:
------------------------------------------------------------
You asked about the dependency 'androidx.lifecycle:lifecycle-viewmodel:2.8.7'.
You have been advised to add this dependency to 'implementation'.
It matched a bundle rule: androidx.lifecycle:lifecycle-viewmodel:2.8.7 was substituted for androidx.lifecycle:lifecycle-viewmodel-android:2.8.7.
------------------------------------------------------------
Shortest path from :myproject to androidx.lifecycle:lifecycle-viewmodel:2.8.7 for myflavorDebugCompileClasspath:
:myproject
\--- androidx.lifecycle:lifecycle-extensions:2.2.0
\--- androidx.lifecycle:lifecycle-viewmodel:2.8.7
Shortest path from :myproject to androidx.lifecycle:lifecycle-viewmodel:2.8.7 for myflavorDebugRuntimeClasspath:
:myproject
\--- androidx.lifecycle:lifecycle-extensions:2.2.0
\--- androidx.lifecycle:lifecycle-viewmodel:2.8.7
(etc)
------------------------------------------------------------
You asked about the dependency 'androidx.paging:paging-common:3.3.6'.
You have been advised to add this dependency to 'implementation'.
It matched a bundle rule: androidx.paging:paging-common:3.3.6 was substituted for androidx.paging:paging-common-android:3.3.6.
------------------------------------------------------------
Shortest path from :myproject to androidx.paging:paging-common:3.3.6 for myflavorDebugCompileClasspath:
:myproject
\--- androidx.paging:paging-common-ktx:3.3.6
\--- androidx.paging:paging-common:3.3.6
Shortest path from :myproject to androidx.paging:paging-common:3.3.6 for myflavorDebugRuntimeClasspath:
:myproject
\--- androidx.paging:paging-common-ktx:3.3.6
\--- androidx.paging:paging-common:3.3.6
(etc)
No idea what all of this means.
@drubio-izzi could you provide the actual output of running buildHealth or projectHealth?
I sent you the output through email. Hope you don't mind.
Should we close it? I don't get these advices anymore.
If I can get a second confirmation, happy to close the issue as resolved.