File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
packages/repack/android/src/main/java/com/callstack/repack Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @callstack/repack " : patch
3
+ ---
4
+
5
+ fix(android): load inspector libraries on initialization
6
+
7
+ Fixes ` UnsatisfiedLinkError ` on React Native 0.80 and above by loading inspector libraries when ` ScriptManagerModule ` is initialized.
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.callstack.repack
2
2
3
3
import android.os.Handler
4
4
import com.facebook.react.bridge.*
5
+ import com.facebook.soloader.SoLoader
5
6
6
7
class ScriptManagerModule (reactContext : ReactApplicationContext ) : ScriptManagerSpec(reactContext) {
7
8
private val nativeLoader = NativeScriptLoader (reactApplicationContext)
@@ -106,6 +107,17 @@ class ScriptManagerModule(reactContext: ReactApplicationContext) : ScriptManager
106
107
}
107
108
108
109
companion object {
110
+ @Volatile
111
+ private var inspectorLoaded = false
112
+
113
+ @Synchronized
114
+ private fun ensureInspectorLoaded () {
115
+ if (BuildConfig .DEBUG && ! inspectorLoaded) {
116
+ SoLoader .loadLibrary(" reactnativejni" )
117
+ inspectorLoaded = true
118
+ }
119
+ }
120
+
109
121
init {
110
122
System .loadLibrary(" callstack-repack" )
111
123
}
You can’t perform that action at this time.
0 commit comments