Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

package name com.reactlibrary is used by other libraries and so might cause issues for projects with lots of dependencies #25

Closed
LydGol90 opened this issue Nov 6, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@LydGol90
Copy link

LydGol90 commented Nov 6, 2019

Describe the bug
When I add the SDK to my project my android build fails due to the error below. I believe that this is caused by the android package name being com.reactlibrary. This name is default and so is also used by other libraries and so if you ever happen to have more than one in your project it will fail. Would it be possible to change the package name to something less risky? I tried changing locally under my node modules and it then built fine.

> Task :app:transformClassesWithMultidexlistForProductionRelease FAILED
D8: Program type already present: com.reactlibrary.BuildConfig

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForProductionRelease'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list:
  Error while merging dex archives:
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: com.reactlibrary.BuildConfig

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 58s
418 actionable tasks: 20 executed, 398 up-to-date

To reproduce
It is difficult to know exactly which other dependency in my project is clashing with this SDK so not sure how to reproduce but I feel like it might be good if we can change the name here to be safe.

SDK version
2.0.2

@bwoskow-ld
Copy link
Member

Hi @LydGol90,

Thanks for pointing this out. Using the com.reactlibrary package was an oversight. We should have properly namespaced our package. I filed an issue on our internal backlog so that we can fix this in the next release.

Note that due to backwards compatibility requirements, the com.reactlibrary package will need to continue existing (albeit as deprecated) for all 2.x.y releases. As a result we'll add a new, properly-namespaced package in the next release, but won't remove the com.reactlibrary package until 3.0.0.

[filed internally as 55402]

@LydGol90
Copy link
Author

LydGol90 commented Nov 7, 2019

@bwoskow-ld Thanks for your quick response, sounds great! I look forward to the next release.

@bwoskow-ld
Copy link
Member

This is fixed in version 2.0.3 of the SDK.

Also, as a side note -- it turns out that backwards compatibility wasn't a concern here because the com.reactlibrary package was only used internally by metro bundler. As a result we were safely able to remove it.

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

No branches or pull requests

3 participants