Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase-dynamic-module-support's monolithic play-core lib dependency causes duplicate classes #3860

Closed
kenshin171 opened this issue Jun 30, 2022 · 5 comments · Fixed by #3870
Assignees
Labels
api: core type: bug Something isn't working

Comments

@kenshin171
Copy link

[REQUIRED] Step 2: Describe your environment

  • Android Studio version:
    Android Studio Dolphin | 2021.3.1 Beta 4
    Build #AI-213.7172.25.2113.8718688, built on June 14, 2022
    Runtime version: 11.0.13+0-b1751.21-8125866 x86_64
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
    macOS 12.4
    GC: G1 Young Generation, G1 Old Generation
    Memory: 2048M
    Cores: 12
    Registry:
    external.system.auto.import.disabled=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.balloon.shadow.size=0

Non-Bundled Plugins:
com.dengzii.plugin.adb (2022.1.22)
com.chrisrm.idea.MaterialThemeUI (6.16.2)

  • Firebase Component: com.google.firebase:firebase-dynamic-module-support
  • Component version: 16.0.0-beta01

[REQUIRED] Step 3: Describe the problem

firebase-dynamic-module-support has a dependency on com.google.android.play:core which causes Duplicate class error durig compilation when using the new non-monolithic com.google.android.play:app-update and com.google.android.play:review libraries.

+--- com.google.firebase:firebase-dynamic-module-support:16.0.0-beta01
|    +--- com.google.android.play:core:1.9.0 -> 1.10.3
|    +--- com.google.firebase:firebase-common:20.0.0 -> 20.1.1 (*)
|    \--- com.google.firebase:firebase-components:17.0.0 (*)

part of the error output

Duplicate class com.google.android.play.core.appupdate.AppUpdateInfo found in modules app-update-2.0.0-runtime (com.google.android.play:app-update:2.0.0) and core-1.10.3-runtime (com.google.android.play:core:1.10.3)
Duplicate class com.google.android.play.core.appupdate.AppUpdateManager found in modules app-update-2.0.0-runtime (com.google.android.play:app-update:2.0.0) and core-1.10.3-runtime (com.google.android.play:core:1.10.3)
Duplicate class com.google.android.play.core.appupdate.AppUpdateManagerFactory found in modules app-update-2.0.0-runtime (com.google.android.play:app-update:2.0.0) and core-1.10.3-runtime (com.google.android.play:core:1.10.3)
Duplicate class com.google.android.play.core.appupdate.AppUpdateOptions found in modules app-update-2.0.0-runtime (com.google.android.play:app-update:2.0.0) and core-1.10.3-runtime (com.google.android.play:core:1.10.3)
Duplicate class com.google.android.play.core.appupdate.AppUpdateOptions$Builder found in modules app-update-2.0.0-runtime (com.google.android.play:app-update:2.0.0) and core-1.10.3-runtime (com.google.android.play:core:1.10.3)
Duplicate class com.google.android.play.core.appupdate.testing.FakeAppUpdateManager found in modules app-update-2.0.0-runtime (com.google.android.play:app-update:2.0.0) and core-1.10.3-runtime (com.google.android.play:core:1.10.3)

Steps to reproduce:

import both com.google.firebase:firebase-dynamic-module-support:16.0.0-beta01 and com.google.android.play:app-update and/or com.google.android.play:review

Relevant Code:

implmentation "com.google.firebase:firebase-dynamic-module-support:16.0.0-beta01"
implmentation "com.google.android.play:review:2.0.0"
implmentation "com.google.android.play:app-update:2.0.0"
@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@argzdev
Copy link
Contributor

argzdev commented Jul 5, 2022

Thanks for reporting this, @kenshin171. I experienced the same behavior. I'll notify our engineer and see what we can do here.

@argzdev argzdev added the type: bug Something isn't working label Jul 5, 2022
@argzdev
Copy link
Contributor

argzdev commented Jul 5, 2022

While this is being worked on by our engineers. As an alternative solution, could you try the following and see if this works?

    implementation ('com.google.firebase:firebase-dynamic-module-support:16.0.0-beta01') {
        exclude group: 'com.google.android.play', module:'core'
    }
    implementation "com.google.android.play:review:2.0.0"
    implementation "com.google.android.play:app-update:2.0.0"
    implementation "com.google.android.play:feature-delivery:2.0.0"

@kenshin171
Copy link
Author

I think this is quite risky? I do not know what other api does firebase-dynamic-module-support uses from com.google.android.play:core, by excluding play-core unilterally may cause other unintentional issues .

@argzdev
Copy link
Contributor

argzdev commented Jul 6, 2022

Since the core library has been partitioned into 4 separate libraries, in theory, if we exclude the core library and included the 4 separate libraries then it should work. Since com.google.firebase:firebase-dynamic-module (if I'm not mistaken) uses review, app-update, feature-delivery.

However, you're correct, this might be risky since we can't exactly test this. Let's wait for the fix for now. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: core type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants