-
Notifications
You must be signed in to change notification settings - Fork 884
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
[Android] Wrong packageName for multiple app modules #938
Comments
Yes, I know that I can use |
Hey there! We try to partially tackle this with #871, can you have a look? |
We're working on merging it soon. Thanks for opening issue and providing additional context! |
Unfortunately, this PR is not fixing your issue.
Currently, it is a CLI limitation that we support a SINGLE module, not an array. We will need to change the core of the CLI to support it. It's on our backlog. |
To make this work, we would have to get rid of Instead, change this:
to
and then, encourage users to use some helpers, such as:
so that we can define that later, not while generating the |
Another option is to detect multiple packages and generate This is non-breaking. This would require we convert |
Unsure if this is related, but I've been struggling to get auto inking to work on Android since upgrading:
The issue lies with attempting to autolink a library that is contained in our repository as a submodule directory. This submodule also happens to contain a runnable React Native app (which is why I suspect the issue occurs). Prior to the version upgrades listed above, the autolinking worked as expected. Now it fails and presents this error:
Ultimately the only solution I could get to work was to disable autolinking on Android for that dependency and revert to manual linking, which then works as expected. This is an acceptable solution for me, but curious if there is a bigger issue or way to resolve this for others that may have the came experience. |
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
Environment
System:
OS: macOS 10.15.2
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 81.31 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.4.0 - /usr/local/bin/node
Yarn: 1.17.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
create-react-native-module: 0.11.0
react-native-cli: 2.0.1
Description
On an Android Project which has multiple app modules, the generated PackageList (presumably for auto-linking) attempts to import the wrong BuildConfig and R resources for any module which is not first (alphabetically).
So, assuming you go to build the second app module, the CLI will attempt to import the module's BuildConfig and R resources under the package name of the first module.
Reproducible Demo
android
folder, copy theapp
directory into another new directory ("bapp")settings.gradle
for the projectapp
module.bapp
moduleExpected behavior:
bapp
should build.Observed behavior:
bapp
fails to build as generated PackageList file attempts to import BuildConfig & R using package id fromapp
module.The text was updated successfully, but these errors were encountered: