Skip to content

Redundant variant suggestion #1695

Description

@emartynov

Plugin version
3.9.0

(Optional) Android Gradle Plugin (AGP) version
9.2.0

(Optional) reason output for bugs relating to incorrect advice

Source: variants1Debug, main
---------------------
* Exposes 1 class: com.airbnb.lottie.LottieAnimationView (implies api).

Source: variant1Release, main
-----------------------
* Exposes 1 class: com.airbnb.lottie.LottieAnimationView (implies api).

Describe the bug
Project with two build variants. The variant1Api dependency is ignored and suggested transitive dependencies variant1DebugApi and variant1ReleaseApi.

To Reproduce
Have android project with variants. Here is code of our convention plugin:

    private fun CommonExtension.setProductFlavors() {
         flavorDimensions.add("tenant")

        productFlavors {
            create("variant1") {
                dimension = "tenant"
            }
            create("variant2") {
                dimension = "tenant"
            }
        }
    }

Expected behavior
No advice is giving

Additional context
Might be issue with AGP because when I run fixDependency and these suggestion is applied, I'm getting gradle script compilation:

Script compilation errors:

  Line 104:     variant1DebugApi(libs.lottie)
                ^ Unresolved reference 'variant1DebugApi'.

  Line 117:   variant1ReleaseApi(libs.lottie)
              ^ Unresolved reference 'variant1ReleaseApi'.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions