diff --git a/packages/react-native/ReactAndroid/gradle.properties b/packages/react-native/ReactAndroid/gradle.properties index 48f489a1d0e984..c98e45ce5e8517 100644 --- a/packages/react-native/ReactAndroid/gradle.properties +++ b/packages/react-native/ReactAndroid/gradle.properties @@ -7,7 +7,7 @@ ANDROIDX_AUTOFILL_VERSION=1.1.0 ANDROIDX_TEST_VERSION=1.1.0 ANDROIDX_TRACING_VERSION=1.1.0 ASSERTJ_VERSION=3.21.0 -FBJNI_VERSION=0.3.0 +FBJNI_VERSION=0.4.0 FRESCO_VERSION=2.5.0 INFER_ANNOTATIONS_VERSION=0.18.0 JAVAX_INJECT_VERSION=1 diff --git a/packages/react-native/ReactAndroid/hermes-engine/build.gradle b/packages/react-native/ReactAndroid/hermes-engine/build.gradle index 15a2f49b0969a3..f2a4f8d675df17 100644 --- a/packages/react-native/ReactAndroid/hermes-engine/build.gradle +++ b/packages/react-native/ReactAndroid/hermes-engine/build.gradle @@ -222,7 +222,7 @@ android { } dependencies { - implementation("com.facebook.fbjni:fbjni:0.3.0") + implementation("com.facebook.fbjni:fbjni:0.4.0") implementation("com.facebook.soloader:soloader:0.10.4") implementation("com.facebook.yoga:proguard-annotations:1.19.0") implementation("androidx.annotation:annotation:1.3.0") diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp b/packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp index 616861539d1749..0940a6ea48a1e2 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp @@ -430,15 +430,9 @@ jsi::JSError convertThrowableToJSError( } jsi::Object cause(runtime); - auto getName = throwable->getClass() - ->getClass() - ->getMethod()>("getName"); - auto getMessage = - throwable->getClass()->getMethod()>( - "getMessage"); - auto message = getMessage(throwable)->toStdString(); - cause.setProperty( - runtime, "name", getName(throwable->getClass())->toStdString()); + auto name = throwable->getClass()->getCanonicalName()->toStdString(); + auto message = throwable->getMessage()->toStdString(); + cause.setProperty(runtime, "name", name); cause.setProperty(runtime, "message", message); cause.setProperty(runtime, "stackElements", std::move(stackElements));