Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import com.facebook.react.bridge.JavaScriptExecutorFactory
import com.facebook.react.bridge.ReactContext
import com.facebook.react.devsupport.interfaces.DevSupportManager
import com.facebook.react.packagerconnection.PackagerConnectionSettings
import com.facebook.soloader.SoLoader
import com.microsoft.reacttestapp.BuildConfig
import com.microsoft.reacttestapp.MainActivity
import com.microsoft.reacttestapp.R
Expand Down Expand Up @@ -171,10 +170,7 @@ class TestAppReactNativeHost(
return reactInstanceManager
}

override fun getJavaScriptExecutorFactory(): JavaScriptExecutorFactory {
SoLoader.init(application, false)
return HermesExecutorFactory()
}
override fun getJavaScriptExecutorFactory(): JavaScriptExecutorFactory = HermesExecutorFactory()

override fun getJSMainModuleName() = "index"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class TestApp :
override fun onCreate() {
super.onCreate()

@Suppress("DEPRECATION")
SoLoader.init(this, false)

reactNativeBundleNameProvider = ReactBundleNameProvider(this, manifest.bundleRoot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class TestApp :
override fun onCreate() {
super.onCreate()

@Suppress("DEPRECATION")
SoLoader.init(this, false)

reactNativeBundleNameProvider = ReactBundleNameProvider(this, manifest.bundleRoot)
Expand Down
19 changes: 15 additions & 4 deletions android/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
ext {
apply(from: "${buildscript.sourceFile.getParent()}/test-app-util.gradle")

compileSdkVersion = rootProject.findProperty("react.compileSdkVersion") ?: 34
minSdkVersion = rootProject.findProperty("react.minSdkVersion") ?: 23
targetSdkVersion = rootProject.findProperty("react.targetSdkVersion") ?: 33

/**
* Returns the recommended Gradle plugin version for the specified React Native
* version.
Expand All @@ -21,7 +17,22 @@ ext {
}
}

// TODO: Bump `minSdkVersion` to 24 in 4.0
def getDefaultMinSdkVersion = { reactNativeVersion ->
if (reactNativeVersion >= v(0, 76, 0)) {
return 24
} else {
return 23
}
}

reactNativeVersion = getPackageVersionNumber("react-native", rootDir)

compileSdkVersion = rootProject.findProperty("react.compileSdkVersion") ?: 34
minSdkVersion = rootProject.findProperty("react.minSdkVersion")
?: getDefaultMinSdkVersion(reactNativeVersion)
targetSdkVersion = rootProject.findProperty("react.targetSdkVersion") ?: 33

autodetectReactNativeVersion = reactNativeVersion == 0 || reactNativeVersion >= v(0, 71, 0)
enableNewArchitecture = isNewArchitectureEnabled(project)
enableBridgeless = isBridgelessEnabled(project, enableNewArchitecture)
Expand Down
6 changes: 3 additions & 3 deletions android/test-app-util.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ ext.getApplicationId = {

ext.getArchitectures = { project ->
def archs = project.findProperty("react.nativeArchitectures")
?: project.findProperty("reactNativeArchitectures")
?: project.findProperty("reactNativeArchitectures")
return archs != null
? archs.split(",")
: ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
Expand Down Expand Up @@ -284,7 +284,7 @@ ext.getVersionName = {
ext.isBridgelessEnabled = { project, isNewArchEnabled ->
if (isNewArchEnabled) {
def bridgelessEnabled = project.findProperty("react.bridgelessEnabled")
?: project.findProperty("bridgelessEnabled")
?: project.findProperty("bridgelessEnabled")
if (bridgelessEnabled != "false") {
def version = getPackageVersionNumber("react-native", project.rootDir)
def isSupported = version == 0 || version >= v(0, 73, 0)
Expand Down Expand Up @@ -314,7 +314,7 @@ ext.isFabricEnabled = { project ->

ext.isNewArchitectureEnabled = { project ->
def newArchEnabled = project.findProperty("react.newArchEnabled")
?: project.findProperty("newArchEnabled")
?: project.findProperty("newArchEnabled")
if (newArchEnabled == "true") {
def version = getPackageVersionNumber("react-native", project.rootDir)
def isSupported = version == 0 || version >= v(0, 71, 0)
Expand Down