-
Notifications
You must be signed in to change notification settings - Fork 899
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
--run-android with --main-activity class not in main package not possible #1212
Comments
The monkey style works for me on Android 4.4 real device and android 9 emulator, for what it's worth:
|
@zoontek you might be interested in this, it affects the dev experience on react-native-bootsplash in that the react-native CLI doesn't launch the app the same way the android launcher does, so developers may not realize it but they aren't seeing what the release bootsplash experience will be in their usual dev launches |
@mikehardy I will remove the need for |
good to hear @zoontek - I still really like the change to "monkey" style launch here though as it delegates the launch activity resolution to the system |
This was fixed in #1242 |
Environment
Description
Hi there!
If you have a launch activity with a fully-qualified class name that is not in your main application package, it is not possible to use the CLI to launch it, as the main application package is pre-pended to the specified main activity even if the activity is fully qualified
cli/packages/platform-android/src/commands/runAndroid/tryLaunchAppOnDevice.ts
Line 30 in f76add9
I believe the correct thing to do is to check of the
--main-activity
begins with a.
character or not, and only pretend the package name if it begins with a periodNote: you cannot just send the activity in without pre-pending package name to it otherwise it does not work with build flavors
Another possibility is to ask the Android "monkey" to simulate an icon click so the default launcher resolves the launcher activity for you: https://stackoverflow.com/a/29931521/9910298
Either would work.
Would you guys like a PR? If so, which direction?
Reproducible Demo
This comes up with the react-native-bootsplash package - there is no way to start the launcher activity so the dev experience does not actually simulate what release will feel like:
https://github.com/zoontek/react-native-bootsplash/blob/db874a022c97d981c211b2a92a3104d6a5d42c0a/example/android/app/src/main/AndroidManifest.xml#L23
The text was updated successfully, but these errors were encountered: