fix: remove @ character from module names #910
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
The
@characters from npm scoped packages will cause name conflicts with Kotlin because Kotlin complier will generate.kotlin_modulefiles base on module name by default.For example, we have both
@segment/analytics-react-nativeand@matt-block/react-native-in-app-browsermodules installed. Currently they will be turned into Android modules with name@segment_analytics-react-nativeand@matt-block_react-native-in-app-browser. And they will both generateMETA-INF/-no-jdk.kotlin_modulefile because Kotlin complier failed to parse@in module name.Eventually it causes build to fail with error:
Test Plan:
Tested the code change on our project and it will convert module names into
segment_analytics-react-nativeandmatt-block_react-native-in-app-browser. And Kotlin will generatesegment_analytics-react-native_debug.kotlin_moduleandmatt-block_react-native-in-app-browser_debug.kotlin_moduleinMETA-INF. Thus the error is resolved.