Skip to content

Commit

Permalink
fix: android dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqingchen committed Nov 20, 2024
1 parent 340356d commit 3def245
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 133 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.tarodemo.devmanager

import android.app.Application
import com.facebook.react.JSEngineResolutionAlgorithm
import com.facebook.react.PackageList
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultReactNativeHost
Expand All @@ -19,9 +20,12 @@ open class TaroReactNativeHost(application: Application) : DefaultReactNativeHos
add(DevManagerPackage())
}
}
override fun getJSEngineResolutionAlgorithm(): JSEngineResolutionAlgorithm? {
return if (isHermesEnabled) JSEngineResolutionAlgorithm.HERMES else super.getJSEngineResolutionAlgorithm()
}

override var isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED

override var isHermesEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override var isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED

}
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rootProject.name = 'taroDemo'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
includeBuild(file('../node_modules/@react-native/gradle-plugin').toPath().toRealPath().toAbsolutePath().toString())

apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
Loading

0 comments on commit 3def245

Please sign in to comment.