Skip to content

Commit 5064d47

Browse files
fix: drop support for RN < 0.80
1 parent 1d69e5d commit 5064d47

1 file changed

Lines changed: 2 additions & 31 deletions

File tree

packages/react-native-brownfield/android/src/main/java/com/callstack/reactnativebrownfield/ReactNativeBrownfield.kt

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import androidx.activity.OnBackPressedCallback
77
import androidx.fragment.app.FragmentActivity
88
import androidx.lifecycle.DefaultLifecycleObserver
99
import androidx.lifecycle.LifecycleOwner
10-
import com.callstack.reactnativebrownfield.utils.VersionUtils
1110
import com.facebook.react.ReactHost
1211
import com.facebook.react.ReactInstanceEventListener
1312
import com.facebook.react.ReactPackage
@@ -28,13 +27,6 @@ fun interface OnMessageListener {
2827
fun onMessage(message: String)
2928
}
3029

31-
/**
32-
* The threshold RN version based on which we decide whether to
33-
* load JNI libs or not. We only load JNI libs on version less
34-
* than this.
35-
*/
36-
private const val RN_THRESHOLD_VERSION = "0.80.0"
37-
3830
class ReactNativeBrownfield private constructor(val reactHost: ReactHost) {
3931
private val messageListeners = CopyOnWriteArrayList<OnMessageListener>()
4032

@@ -54,29 +46,8 @@ class ReactNativeBrownfield private constructor(val reactHost: ReactHost) {
5446
}
5547

5648
private fun loadNativeLibsInternal(application: Application) {
57-
val rnVersion = BuildConfig.RN_VERSION
58-
59-
if (VersionUtils.isVersionLessThan(rnVersion, RN_THRESHOLD_VERSION)) {
60-
SoLoader.init(application.applicationContext, OpenSourceMergedSoMapping)
61-
load()
62-
} else {
63-
try {
64-
val reactNativeApplicationEntryPointClazz =
65-
Class.forName("com.facebook.react.ReactNativeApplicationEntryPoint")
66-
val loadReactNativeMethod = reactNativeApplicationEntryPointClazz.getMethod(
67-
"loadReactNative",
68-
android.content.Context::class.java
69-
)
70-
loadReactNativeMethod.invoke(null, application.applicationContext)
71-
} catch (e: ClassNotFoundException) {
72-
throw RuntimeException(
73-
"ReactNativeApplicationEntryPoint not found. Ensure the brownfield AAR " +
74-
"consumer-rules.pro is applied and ReactNativeApplicationEntryPoint is " +
75-
"not stripped by R8.",
76-
e
77-
)
78-
}
79-
}
49+
SoLoader.init(application.applicationContext, OpenSourceMergedSoMapping)
50+
load()
8051
}
8152

8253
@JvmStatic

0 commit comments

Comments
 (0)