Skip to content

Commit

Permalink
Enable new arch in the example app
Browse files Browse the repository at this point in the history
  • Loading branch information
j-piasecki committed Feb 9, 2023
1 parent d82c80f commit abed02f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
18 changes: 17 additions & 1 deletion example/android/build.gradle
Expand Up @@ -28,6 +28,7 @@ task fetchDependencies() {
buildscript {
def androidTestAppDir = "../../node_modules/react-native-test-app/android"
apply from: "$androidTestAppDir/dependencies.gradle"
apply from: "${androidTestAppDir}/test-app-util.gradle"

// Mainly for Detox testing for using Next Storage
// when building next, force using next storage
Expand All @@ -43,11 +44,26 @@ buildscript {
}

dependencies {
classpath "com.android.tools.build:gradle:$androidPluginVersion"
getReactNativeDependencies().each { dependency ->
classpath(dependency)
}

if (isNewArchitectureEnabled(project)) {
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.1.0")
}
}
}

allprojects {
// TODO: remove when https://github.com/facebook/react-native/issues/35495 is fixed
project.pluginManager.withPlugin("com.facebook.react") {
react {
reactNativeDir = rootProject.file("../../node_modules/react-native/")
codegenDir = rootProject.file("../../node_modules/react-native-codegen/")
}
}

repositories {
maven {
url("$rootDir/../../node_modules/detox/Detox-android")
Expand Down
4 changes: 3 additions & 1 deletion example/android/gradle.properties
Expand Up @@ -36,7 +36,7 @@ android.enableJetifier=true

# Enable new architecture, i.e. Fabric + TurboModule - implies USE_FABRIC=1.
# Note that this is incompatible with web debugging.
#newArchEnabled=true
newArchEnabled=true

# Uncomment the line below if building react-native from source
#ANDROID_NDK_VERSION=21.4.7075529
Expand All @@ -50,3 +50,5 @@ KOTLIN_VERSION=1.6.21
# Enable dedicated thread pool executor
AsyncStorage_dedicatedExecutor=true
AsyncStorage_useNextStorage=true

REACT_NATIVE_NODE_MODULES_DIR=../node_modules/react-native

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit abed02f

Please sign in to comment.