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

@nrwl/react-native:run-android could support active-arch-only flag #15045

Closed
1 task done
ste7en opened this issue Feb 16, 2023 · 1 comment · Fixed by #15050
Closed
1 task done

@nrwl/react-native:run-android could support active-arch-only flag #15045

ste7en opened this issue Feb 16, 2023 · 1 comment · Fixed by #15050
Assignees
Labels

Comments

@ste7en
Copy link
Contributor

ste7en commented Feb 16, 2023

Description

This flag is suggested by the react-native team to speed up native build phases. This is due to the fact that, when building an Android app locally, it builds all the 4 supported ABIs (i.e. armeabi-v7a, arm64-v8a, x86 and x86_64. However when building and testing locally on an emulator or physical device we don't need all of them.

Motivation

This should reduce the native build time by a ~75% factor. (ref)

Suggested Implementation

Add an executor option flag (e.g. activeArchOnly) that passes the --active-arch-only argument to react-native CLI.

Alternate Implementations

Use the nx:run-commands executor with the command react-native run-android --active-arch-only.
For example my project.json looks like this:

"run-android": {
  "executor": "nx:run-commands",
  "options": {
    "command": "react-native run-android --active-arch-only",
    "cwd": "apps/my-mobile-app"
  }
}
ste7en pushed a commit to ste7en/nx that referenced this issue Feb 16, 2023
This solves issue nrwl#15045 and adds the possibility to pass as argument to React Native CLI's
run-android the flag --active-arch-only to only build for the current architecture, reducing native
build times by up to 75%.

closed nrwl#15045
@AgentEnder AgentEnder added the scope: react-native Issues relating to React Native label Feb 16, 2023
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants