Repository navigation
fix(mobile): fresh Android builds no longer crash on launch - #20118
Open
marmar9615-cloud wants to merge 2 commits into
Open
marmar9615-cloud wants to merge 2 commits into
marmar9615-cloud wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The PR makes a narrowly scoped Android build correction by pinning fbjni to React Native's compatible version, preventing a pre-JavaScript startup crash. Its Expo wiring and Gradle generation behavior are covered by focused tests, with no new user-facing capability or sensitive configuration change. You can add or adjust custom eligibility rules. Learn more. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fresh Android builds crash before JavaScript starts. react-native-shiki-engine 0.3.12 requests
com.facebook.fbjni:fbjni:+, and Gradle now resolves that to fbjni 0.8.1 instead of React Native's 0.7.0. fbjni 0.8.1 is built with NDK 28 and imports__cxa_init_primary_exception. React Native's NDK 27libc++_shared.sodoes not export that symbol, solibfbjni.sofails to load inMainApplication.onCreate. Debug and release builds resolve the same way. A Gradle cache that still holds 0.7.0 hides the crash until the cache expires.Change
Add an Expo config plugin, registered next to
withAndroidGradleHeap, that appends the block below to the generated rootandroid/build.gradle.The force covers every Gradle project, so shiki-engine's own classpaths get 0.7.0 too, not only the app's. The tests compare the generated Groovy and Kotlin text with the
fbjniversion in React Native's installed version catalog. A React Native upgrade that moves fbjni therefore fails the tests until the pin moves with it.shiki-engine 0.4.0, released October 13, drops
fbjni:+(skiniks/react-native-shiki-engine#275). Once the app is on 0.4.0, this pin is no longer needed. I did not bump it here because 0.4.0 also changes native module registration, caching and regex matching on Android and iOS, and I could not test those changes on a device.A new config plugin changes the native fingerprint on both platforms, as #12394 did. Merging it should trigger new Android and iOS store builds, and an OTA update cannot replace
libfbjni.so. It needs the Native Change label, which the fingerprint workflow does not add to fork PRs.Scope and approval
Fixes #13710. Julius accepted the bug and prescribed this fix in the triage comment.
This replaces #13967. Thanks to bompus for the report, Julius for the triage, j-gaertig for the device confirmation, kvnloo for #13967, and andybergon for validating #13967 and suggesting the version catalog test.
Verification
These ran on this branch with React Native 0.88.0-rc.3 and Node 24.
:appor only to the root project, if it pins 0.8.1, ifapp.config.tsstops registering the plugin, or if a second prebuild appends the block again.expo prebuild --platform androidruns and one--no-cleanrun produce the same rootbuild.gradlewith one force block. Compared with main, the 92 generated Android files differ only by that block.react-android:0.88.0-rc.3metadata. Without the block, the app and shiki-engine resolve fbjni 0.8.1 in release and debug, compile and runtime. With the block, all of them resolve 0.7.0 as a forced version. A force on:appalone leaves shiki-engine on 0.8.1.libfbjni.soandlibc++_shared.soare byte-identical to fbjni 0.7.0's on all four ABIs. fbjni 0.8.1'slibfbjni.soimports__cxa_init_primary_exceptionon every ABI, and React Native'slibc++_shared.sodoes not export it.git diff --checkis clean.Earlier runs on React Native 0.86.3, before the 0.88 upgrade, used the same force. j-gaertig's preview APK launched on a Galaxy A55. andybergon built release APKs for all four ABIs from #13967 and cold-launched the arm64 APK five times on an Android 16 emulator.
I did not build an APK or launch anything on this branch. The Gradle probe uses Gradle 9.5.1 stand-in projects, not AGP or the generated 9.4.1 wrapper. Expo's config loader fails on my machine, so I have no valid local fingerprint, and CI has to show the fingerprint change. If the pinned version changes later, run a clean prebuild, because
--no-cleankeeps an existing marked block.