Open BenTilbrook opened 1 year ago
Thanks for the report and the reproducer!
Do you know if this issue still exists in the latest version (1.24.0 at time of writing)?
I'm still having the issue with 1.24 on my project => https://github.com/simonlebras/rickandmorty/blob/main/app/build.gradle.kts#L120 (if I remove this block, the check will fail)
Unfortunately I don't have time to work on this. I have added the sponsorable
label to indicate that I could shift my priorities if someone wants to sponsor the work. PRs are also welcome.
Also ran into this problem, dependency-analysis would somehow false positive with coil even after disabling hilt 🤷
Description When the Hilt Gradle Plugin is applied (Hilt can be used without the Gradle plugin, but this issue pertains to when the plugin is in use), Dependency Analysis Gradle Plugin falsely considers a project dependency unused, when in fact it is used.
In the attached sample project below, run the command
./gradlew app:projectHealth
. It should succeed due to no unused dependencies, but it fails, falsely flagging:impl
as unused.If Hilt Gradle Plugin is applied is not applied, the Dependency Analysis Gradle Plugin gives correct advice.
If you run
./gradlew testReleaseUnitTest
after applying the plugin's false advice, the build will fail, demonstrating that the dependency is required.Build scan link https://gradle.com/s/k7vtaivpaxksc
Plugin version
1.13.1
Gradle version
7.5.1
Android Gradle Plugin (AGP) version
7.3.0
reason
output for bugs relating to incorrect adviceDescribe the bug
To Reproduce Steps to reproduce the behavior:
./gradlew app:projectHealth
in attached sample projectExpected behavior Plugin does NOT advise to remove dependency
:impl
Actual behavior Plugin advises to remove
:impl
.Sample project See attached.
HiltDependencyExample.zip