Skip to content
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

Fix package name for main activity when appId set #1242

Merged

Conversation

grahamsmith
Copy link
Contributor

Summary:

Working on a white label feature for an app, I ran into an issue where I needed to set the appId differently to the package name and an explicit main activity in a different package.

For example my build.gradle application ID could be com.test and the manifest package be com.test however my main activity, from a dependency, has been set explicitly set in the manifest as com.dependency.AnActivity.

When running:

react-native run-android --appId com.test --main-activity com.dependency.AnActivity

the result would be:

Error: Activity class {com.test/com.packagename.com.dependency.AnActivity} does not exist.

I have made a small change to allow an explicit main activity with package name set.

Test Plan:

Run similar to react-native run-android --appId com.test --main-activity com.dependency.AnActivity and expect the explicit activity to start.

Run react-native run-android --appId com.test --main-activity AnActivity and expect the detected package name to be the prefix of the specified activity.

@thymikee
Copy link
Member

Lint is failing, can you run yarn lint --fix?

@thymikee thymikee requested a review from troZee August 10, 2020 17:05
@grahamsmith
Copy link
Contributor Author

@thymikee - is there anything I need to do to get this merged? First time contributor to this repo so just checking.

@thymikee
Copy link
Member

I'd like @Esemesek and @troZee to have a look as well :)

@grahamsmith
Copy link
Contributor Author

Sorry to be that guy but can I get an ETA to merge this please? It's blocking some other OSS updates going out that will fix some issues for others.

@thymikee
Copy link
Member

thymikee commented Sep 3, 2020

@grabbou please make sure to prioritize this on your ramp up today, it would be lovely to have it in and released today/tomorrow :)

@thymikee
Copy link
Member

thymikee commented Sep 3, 2020

@grahamsmith sorry for our slow response here, we were occupied with lots of extra activities recently, including organizing and preparing for React Native EU (which starts in few minutes!! stream here: https://www.youtube.com/watch?v=DduUntL2Sv4). Hopefully we'll regain some time to get back to CLI maintenance :). I also hope we didn't discouraged you from future contributions 😊

@thymikee thymikee merged commit a6cc6c8 into react-native-community:master Sep 4, 2020
@thymikee
Copy link
Member

thymikee commented Sep 8, 2020

@grahamsmith this is now released in v4.13, thank you!

@grahamsmith
Copy link
Contributor Author

Amazing news. Thanks for sorting that out.

thymikee added a commit that referenced this pull request Sep 17, 2020
* origin/master: (81 commits)
  chore(deps): bump node-fetch from 2.6.0 to 2.6.1 (#1267)
  v4.13.0
  chore: remove await in getLatestFile function call from downloadProfile file. (#1266)
  Augment react-native info with out of tree platform packages info (#1264)
  feat: add a command to download the Hermes Sampling Profiler to a local machine (#1246)
  chore(deps): bump lodash from 4.17.15 to 4.17.19 (#1221)
  Fix package name for main activity when appId set (#1242)
  Just use the users default browser (#1257)
  feat: improve progress indicator for iOS builds without xcpretty (#1254)
  fix: 🐛 executableFolderPath to run app name in iOS 14.0 (#1236)
  chore(deps): bump elliptic from 6.5.2 to 6.5.3 (#1233)
  v4.12.0
  Add Windows info to react-native info (#1227)
  add new version RN Podfile link, autolinking docs. (#1245)
  docs: add linkage instructions for `yarn` v2 (#1237)
  v4.11.0
  fix: adjust range on react-native peer dep to support 0.63 (#1234)
  chore: update jest config (#1241)
  Use new chrome based edge if the user is already running it, and not running chrome (#1222)
  Add windows logic to guess the users preferred editor for launchEditor (#1216)
  ...
thymikee added a commit to imoans/cli that referenced this pull request Sep 17, 2020
* origin/master: (47 commits)
  chore(breaking): use Node 10 as compile target (react-native-community#1072)
  chore(deps): bump node-fetch from 2.6.0 to 2.6.1 (react-native-community#1267)
  v4.13.0
  chore: remove await in getLatestFile function call from downloadProfile file. (react-native-community#1266)
  Augment react-native info with out of tree platform packages info (react-native-community#1264)
  feat: add a command to download the Hermes Sampling Profiler to a local machine (react-native-community#1246)
  chore(deps): bump lodash from 4.17.15 to 4.17.19 (react-native-community#1221)
  Fix package name for main activity when appId set (react-native-community#1242)
  Just use the users default browser (react-native-community#1257)
  feat: improve progress indicator for iOS builds without xcpretty (react-native-community#1254)
  fix: 🐛 executableFolderPath to run app name in iOS 14.0 (react-native-community#1236)
  chore(deps): bump elliptic from 6.5.2 to 6.5.3 (react-native-community#1233)
  v4.12.0
  Add Windows info to react-native info (react-native-community#1227)
  add new version RN Podfile link, autolinking docs. (react-native-community#1245)
  docs: add linkage instructions for `yarn` v2 (react-native-community#1237)
  v4.11.0
  fix: adjust range on react-native peer dep to support 0.63 (react-native-community#1234)
  chore: update jest config (react-native-community#1241)
  Use new chrome based edge if the user is already running it, and not running chrome (react-native-community#1222)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants