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

Use --active-arch-only flag when running React Native CLI build-android command during development #298

Open
achou11 opened this issue Apr 26, 2024 · 2 comments

Comments

@achou11
Copy link
Member

achou11 commented Apr 26, 2024

Helps reduce the amount of time it takes to build the APK and also greatly reduces the size of the resulting APK (~200 MB smaller in our case), which helps installation time (my older phone sometimes struggles to install the APK via adb, probably due to size). Not entirely sure if it makes sense to pass this by default in the android-no-backend-rebuild npm script, so creating an issue to get thoughts.

Outputted docs when running npx react-native build-android --help:

--active-arch-only       Build native libraries only for the current device architecture for debug builds. (default: false)
@achou11
Copy link
Member Author

achou11 commented May 1, 2024

This might be less relevant once we move to Expo, although from a brief look, I don't see any equivalent option/flag that can be passed when starting the android build process (nodejs-mobile-react-native relies on some gradle options to be passed based on the flag)

@achou11
Copy link
Member Author

achou11 commented May 13, 2024

Looks like this has been added to @expo/cli@0.18.0 (we're currently on 0.17.10). Guessing we need to update to Expo SDK 51 to get access to this.

Added building only for connected CPU architectures on Android when using the new architecture

Separately, adding this link since it describes the underlying mechanism that this issue is alluding to: https://reactnative.dev/docs/0.73/build-speed#build-only-one-abi-during-development-android-only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant