8000 Integrating multiple flutter modules into an Android application fails · Issue #118949 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Integrating multiple flutter modules into an Android application fails #118949

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

Closed
rushilsingh opened this issue Jan 21, 2023 · 3 comments
Closed
Labels
r: duplicate Issue is closed as a duplicate of an existing issue

Comments

@rushilsingh
Copy link
rushilsingh commented Jan 21, 2023

Greetings

We are trying to integrate two different flutter modules into our Android application.

We are integrating the modules as AARs as outlined here:
https://docs.flutter.dev/development/add-to-app/android/project-setup

However, we encounter the following error:
Duplicate class com.org1.lib.BuildConfig found in modules jetified-flutter_debug-1.0-runtime (:flutter_module:) and jetified-flutter_debug-1.0-runtime (flutter_module.aar) Duplicate class io.flutter.plugins.GeneratedPluginRegistrant found in the following modules: jetified-flutter_debug-1.0-runtime (:flutter_module:), jetified-flutter_debug-1.0-runtime (flutter_module.aar) and jetified-flutter_release-1.0-runtime (com.org2.sdk:flutter_release:1.0)

I see that there is an existing issue that is related:
#39707

We tried experimenting with the workarounds suggested. However, none of them worked within our constraint i.e. using AAR files for the flutter modules.

Please help.

Thanks.

@rushilsingh rushilsingh changed the title Integrating multiple flutter modules into a native Android or iOS application fails Integrating multiple flutter modules into an Android application Jan 21, 2023
@rushilsingh rushilsingh changed the title Integrating multiple flutter modules into an Android application Integrating multiple flutter modules into an Android application fails Jan 21, 2023
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Jan 23, 2023
@darshankawar
Copy link
Member

Thanks for the report @rushilsingh
I think the error you are getting could be due to the fact that Flutter generates dependency aar with version of their parent instead of the version of dependency.

The multiple flutter modules you are using could be using dependencies which could be using conflicting class names somehow and hence throwing the reported error:

Duplicate class com.org1.lib.BuildConfig found in modules jetified-flutter_debug-1.0-runtime (:flutter_module:) and jetified-flutter_debug-1.0-runtime (flutter_module.aar) Duplicate class io.flutter.plugins.GeneratedPluginRegistrant found in the following modules: jetified-flutter_debug-1.0-runtime (:flutter_module:), jetified-flutter_debug-1.0-runtime (flutter_module.aar) and jetified-flutter_release-1.0-runtime (com.org2.sdk:flutter_release:1.0)

There's a similar issue open that points to related use case in which you can follow-up for further updates: #117359
I am closing this as a duplicate. If you disagree, write in comments and I'll reopen it.

@darshankawar darshankawar added r: duplicate Issue is closed as a duplicate of an existing issue and removed in triage Presently being triaged by the triage team labels Jan 23, 2023
@rushilsingh
Copy link
Author

Thanks for your response @darshankawar

The conflicting dependency is flutter itself.

The conflicting class name GeneratedPluginRegistrant is coming auto-generated code in the .android folder resulting from the 'flutter build aar' command.

@github-actions
Copy link
github-actions bot commented Mar 4, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: duplicate Issue is closed as a duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

2 participants
0