Fix Android instacrashing on JSC with NoSuchMethodException (#43907)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43907

JSC is currently instacrashing because we missed a JvmStatic.
Android will attempt to load JSCInstance.initHybrid which is missing unless we specify JvmStatic.

Changelog:
[Internal] [Changed] - Fix Android instacrashing on JSC with NoSuchMethodException

Reviewed By: GijsWeterings

Differential Revision: D55795290

fbshipit-source-id: 5d10344e3f481dc5832706d77ccf2bf163dfb30f
This commit is contained in:
Nicola Corti
2024-04-05 05:25:31 -07:00
committed by Facebook GitHub Bot
parent d6c21495f7
commit bc832ca3aa
@@ -9,14 +9,16 @@ package com.facebook.react.runtime
import com.facebook.jni.HybridData
import com.facebook.jni.annotations.DoNotStrip
import com.facebook.jni.annotations.DoNotStripAny
import com.facebook.soloader.SoLoader
public class JSCInstance constructor() : JSRuntimeFactory(initHybrid()) {
@DoNotStripAny
public class JSCInstance : JSRuntimeFactory(initHybrid()) {
private companion object {
init {
SoLoader.loadLibrary("jscinstance")
}
@DoNotStrip protected external fun initHybrid(): HybridData
@DoNotStrip @JvmStatic private external fun initHybrid(): HybridData
}
}