diff --git a/ReactAndroid/src/main/jni/react/jscexecutor/CMakeLists.txt b/ReactAndroid/src/main/jni/react/jscexecutor/CMakeLists.txt index 464aa19ccef868..67858803b3cff7 100644 --- a/ReactAndroid/src/main/jni/react/jscexecutor/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/react/jscexecutor/CMakeLists.txt @@ -13,9 +13,22 @@ add_library(jscexecutor SHARED ${jscexecutor_SRC}) target_include_directories(jscexecutor PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +# Patch from Expo: https://github.com/expo/react-native/blob/02714ab44d1e206fa80e81aef618e61017cccdc1/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt#L16-L25 +# Explicitly link libgcc.a to prevent undefined `_Unwind_Resume` symbol and crash from throwing c++ exceptions even someone tries to catch the exceptions. +# according to https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#unwinding, +# we should put the unwinder between static libs and shared libs. +# +# TODO(ncor): we don't need this patch anymore after upgrading to ndk r23 +if(ANDROID_NDK_REVISION VERSION_LESS "23.0.0") + set(LIB_UNWIND gcc) +else() + set(LIB_UNWIND unwind) +endif() + target_link_libraries(jscexecutor jsireact jscruntime + ${LIB_UNWIND} fb fbjni folly_runtime diff --git a/package.json b/package.json index 6119bd30689bfd..e17aa48a77c965 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "event-target-shim": "^5.0.1", "invariant": "^2.2.4", "jest-environment-node": "^29.2.1", - "jsc-android": "^250230.2.1", + "jsc-android": "^250231.0.0", "memoize-one": "^5.0.0", "metro-react-native-babel-transformer": "0.73.5", "metro-runtime": "0.73.5", diff --git a/yarn.lock b/yarn.lock index 640749212e5e5c..742db74a6ba207 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5732,10 +5732,10 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= -jsc-android@^250230.2.1: - version "250230.2.1" - resolved "https://registry.yarnpkg.com/jsc-android/-/jsc-android-250230.2.1.tgz#3790313a970586a03ab0ad47defbc84df54f1b83" - integrity sha512-KmxeBlRjwoqCnBBKGsihFtvsBHyUFlBxJPK4FzeYcIuBfdjv6jFys44JITAgSTbQD+vIdwMEfyZklsuQX0yI1Q== +jsc-android@^250231.0.0: + version "250231.0.0" + resolved "https://registry.yarnpkg.com/jsc-android/-/jsc-android-250231.0.0.tgz#91720f8df382a108872fa4b3f558f33ba5e95262" + integrity sha512-rS46PvsjYmdmuz1OAWXY/1kCYG7pnf1TBqeTiOJr1iDz7s5DLxxC9n/ZMknLDxzYzNVfI7R95MH10emSSG1Wuw== jscodeshift@^0.14.0: version "0.14.0"