-
Notifications
You must be signed in to change notification settings - Fork 25k
fix: Use FQCN to avoid collisions in PackageList.java #54736
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
base: main
Are you sure you want to change the base?
Conversation
|
This works, thanks for sending it over 👍 |
|
@cortinico do you think we should do a change in react native cli config for this or this works? |
|
Nope this is sufficient, we don't need a CLI PR |
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this in D88157961. |
| internal fun composeFileContent(packageClassInstance: String): String = | ||
| generatedFileContentsTemplate | ||
| .replace("{{ packageImports }}", packageImports) | ||
| .replace("{{ packageImports }}", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just remove this line + remove the {{ packageImports }} from the template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done @cortinico . Thanks for pointing out
Summary:
When two different React Native libraries export a package class with the same name but in different namespaces, the generated PackageList.java causes a compilation error due to ambiguous class references.
The current autolinking generates:
Solution:-
Use fully qualified class names (FQCN) instead of imports:
Changelog:
[ANDROID][FIXED]- Use FQCN to avoid collisions
Test Plan:
Updated test.

Also tested on my app and RN tester
CI will tell if build fails