Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This patch remove unused .so files for reduce android .apk and .aab ## Changelog - [Android] [Fixed] - Exclude unused .so files for reduce android .apk and .aab Pull Request resolved: #32257 Test Plan: I have created a repository for testing: https://github.com/enniel/react-native-invalid-build-example That lines includes patch for fix bug: https://github.com/enniel/react-native-invalid-build-example/blob/f195ecdbeaca88ffb57c344615ede45ea0f6ef57/android/app/react.gradle#L331-L385 ```sh git clone https://github.com/enniel/react-native-invalid-build-example cd react-native-invalid-build-example npm i ``` debug, hermes disabled, without patch ```sh git switch hermes-disabled-without-patch npm run build:android:debug:apk ``` open android/app/build/outputs/apk/debug/app-debug.apk in android studio ![debug-hermes-disabled-without-patch](https://user-images.githubusercontent.com/19760944/134640636-1505cfa4-0be9-4bb8-8130-74af01ebfd94.png) debug, hermes enabled, without patch ```sh git switch hermes-enabled-without-patch npm run build:android:debug:apk ``` open android/app/build/outputs/apk/debug/app-debug.apk in android studio ![debug-hermes-enabled-without-patch](https://user-images.githubusercontent.com/19760944/134640743-f5730fbe-433f-45eb-a87c-e0e2eadb056b.png) debug, hermes disabled, with patch ```sh git switch hermes-disabled-with-patch npm run build:android:debug:apk ``` open android/app/build/outputs/apk/debug/app-debug.apk in android studio ![debug-hermes-disabled-with-patch](https://user-images.githubusercontent.com/19760944/134640895-36f294ae-36fb-40b7-a767-f6b421fdbabd.png) debug, hermes enabled, with patch ```sh git switch hermes-enabled-with-patch npm run build:android:debug:apk ``` open android/app/build/outputs/apk/debug/app-debug.apk in android studio ![debug-hermes-enabled-with-patch](https://user-images.githubusercontent.com/19760944/134641040-f4f08755-5234-4567-849d-0b815d58bc15.png) release, hermes disabled, without patch ```sh git switch hermes-disabled-without-patch npm run build:android:release:apk ``` open android/app/build/outputs/apk/release/app-release.apk in android studio ![release-hermes-disabled-without-patch](https://user-images.githubusercontent.com/19760944/134641255-da3ccc5f-91e2-4b12-b0b2-1590fa13e5ce.png) release, hermes enabled, without patch ```sh git switch hermes-enabled-without-patch npm run build:android:release:apk ``` open android/app/build/outputs/apk/release/app-release.apk in android studio ![release-hermes-enabled-without-patch](https://user-images.githubusercontent.com/19760944/134641396-f2ca3178-4225-4de7-b1f7-b741edba1877.png) release, hermes disabled, with patch ```sh git switch hermes-disabled-with-patch npm run build:android:release:apk ``` open android/app/build/outputs/apk/release/app-release.apk in android studio ![release-hermes-disabled-with-patch](https://user-images.githubusercontent.com/19760944/134641675-b967df44-af1b-4070-9f84-a2f029381a39.png) release, hermes enabled, with patch ```sh git switch hermes-enabled-with-patch npm run build:android:release:apk ``` open android/app/build/outputs/apk/release/app-release.apk in android studio ![release-hermes-enabled-with-patch](https://user-images.githubusercontent.com/19760944/134641737-aa4a435a-1fe2-4107-8bbd-8dadda24aebd.png) Reviewed By: cortinico Differential Revision: D31167423 Pulled By: ShikaSD fbshipit-source-id: 4026df818c57fa699526ca1c31c1d1a68d58baef
- Loading branch information
6f12674
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libjscexecutor should not be deleted! In android release, current version (0.67.0) will crash without libjscexecutor.so.
I comment the code 354-356 lines in react.gradle , then everything is ok.
6f12674
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be good without
libjscexecutor.so
aslibjsc.so
should be sufficient for Release only builds. If that is not the case, please open an issue + provide a reproducer