play-services-plugins icon indicating copy to clipboard operation
play-services-plugins copied to clipboard

OSS licences plugin displays all Jetpack Compose dependencies twice

Open marvineffing opened this issue 2 years ago • 2 comments

We have found out that most, if not all, Jetpack Compose dependencies are being displayed twice when showing the OssLicensesMenuActivity. See attached screenshot from my minimum reproducable project. Obviously you'd want to display the dependency licence only once.

I have tried so far to resolve it myself, unsuccessfully.

  • output app dependency tree to a file, and analyze discrepancies, i.e. different depedency artifact versions being used
  • force dependency version usage by adding to app's build.gradle:
configurations {
    configureEach {
        resolutionStrategy {
            force '<specific-compose-dependency-version' (e.g. androidx.compose.animation:animation:1.5.4)
        }
    }
}
  • exclude sub-dependencies, like so
implementation ('androidx.compose.material3:material3:1.1.2') {
    exclude group: 'androidx.compose.animation', module: 'animation'
}

Steps to reproduce the behaviour:

  1. Create a new Android project with empty activity
  2. Add the OSS plugin
  3. Add any compose dependency, in my relevant project I have added the following Jetpack Compose dependencies:
implementation 'androidx.compose.material3:material3:1.1.2'
implementation 'androidx.activity:activity-compose:1.8.0'
implementation 'androidx.compose.ui:ui-text-android:1.5.4'
// Android Studio Preview support
implementation 'androidx.compose.ui:ui-tooling-preview:1.5.4'
debugImplementation 'androidx.compose.ui:ui-tooling:1.5.4'
  1. Add a button that launches the OssLicensesMenuActivity per the official Google example guideline.
  2. Build and install release variant of the app, click the button.
  3. If you scroll down to the Compose section, you should be able to see that all the Compose licences are displayed twice.

Screenshot:

WhatsApp Image 2023-10-26 at 10 38 27

Information

  • Gradle version: 8.2
  • Android Studio version: AS Hedgehog | 2023.1.1 RC Build #AI-231.9392.1.2311.10949950, built on October 14, 2023,
  • Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 x86_64
  • VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
  • Plugin name and version: OSS licences 0.10.6 (com.google.android.gms:oss-licenses-plugin:0.10.6)

marvineffing avatar Oct 26 '23 09:10 marvineffing

@PaulRashidi @caller9 any chance you can review this?

marvineffing avatar Nov 08 '23 13:11 marvineffing

Any update on this?

Garguy avatar Nov 28 '23 14:11 Garguy