Skip to content

Using product flavors causes incorrect advice #1654

@jstefanowski

Description

@jstefanowski

Plugin version
3.6.1

Gradle version
8.13 (also exists on 9.+)

JDK version
21.0.9

Android Gradle Plugin (AGP) version
8.13.2 (the same result on 9.0.1)

reason output for bugs relating to incorrect advice

advice.txt

Describe the bug
Running ./gradlew buildHealth generates an advice that googleImplementation(...) should be replaced with googleDebugImplementation(...), even though the code is used in both debug and release variants. Happens only in project containing product flavors.

  • Package structure:
    Image

  • build.gradle.kts
    Image

  • Advice:

Advice for :app
Existing dependencies which should be modified to be as indicated:
  googleDebugImplementation("com.google.android.play:review:2.0.2") (was googleImplementation)

That may be a coincidence but even though the generated advice are showing correct usage:

Source: googleDebug, main
-------------------------
* Imports 1 class: com.google.android.play.core.review.ReviewInfo (implies implementation).

Source: googleDebug, test
-------------------------
(no usages)

Source: googleRelease, main
---------------------------
* Imports 1 class: com.google.android.play.core.review.ReviewInfo (implies implementation).

I usually see that instead of combining googleDebug and googleRelease to googleImplementation it just takes whichever source value is shown first

Additional context
Project:

DagpBug.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions