Skip to content

Commit abed02f

Browse files
committed
Enable new arch in the example app
1 parent d82c80f commit abed02f

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

example/android/build.gradle

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ task fetchDependencies() {
2828
buildscript {
2929
def androidTestAppDir = "../../node_modules/react-native-test-app/android"
3030
apply from: "$androidTestAppDir/dependencies.gradle"
31+
apply from: "${androidTestAppDir}/test-app-util.gradle"
3132

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

4546
dependencies {
46-
classpath "com.android.tools.build:gradle:$androidPluginVersion"
47+
getReactNativeDependencies().each { dependency ->
48+
classpath(dependency)
49+
}
50+
51+
if (isNewArchitectureEnabled(project)) {
52+
classpath("com.facebook.react:react-native-gradle-plugin")
53+
classpath("de.undercouch:gradle-download-task:5.1.0")
54+
}
4755
}
4856
}
4957

5058
allprojects {
59+
// TODO: remove when https://github.com/facebook/react-native/issues/35495 is fixed
60+
project.pluginManager.withPlugin("com.facebook.react") {
61+
react {
62+
reactNativeDir = rootProject.file("../../node_modules/react-native/")
63+
codegenDir = rootProject.file("../../node_modules/react-native-codegen/")
64+
}
65+
}
66+
5167
repositories {
5268
maven {
5369
url("$rootDir/../../node_modules/detox/Detox-android")

example/android/gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ android.enableJetifier=true
3636

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

4141
# Uncomment the line below if building react-native from source
4242
#ANDROID_NDK_VERSION=21.4.7075529
@@ -50,3 +50,5 @@ KOTLIN_VERSION=1.6.21
5050
# Enable dedicated thread pool executor
5151
AsyncStorage_dedicatedExecutor=true
5252
AsyncStorage_useNextStorage=true
53+
54+
REACT_NATIVE_NODE_MODULES_DIR=../node_modules/react-native

example/ios/AsyncStorageExample.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)