Skip to content

Commit

Permalink
Fix Android instacrashing on JSC with NoSuchMethodException (#43907)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
cortinico authored and facebook-github-bot committed Apr 5, 2024
1 parent d6c2149 commit bc832ca
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit bc832ca

Please sign in to comment.