From 56cb67dc8fc5410025eeaef44cc2dff2fe8d407f Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Dall'Agnol Date: Fri, 8 Mar 2024 09:55:06 -0800 Subject: [PATCH] [docs] Update template bare minimum diffs (#27520) # Why Follow up of https://github.com/expo/expo/pull/27502 # How `et generate-bare-diffs` # Test Plan CI Should pass # Checklist - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --- .../static/diffs/template-bare-minimum/diffInfo.json | 2 +- .../static/diffs/template-bare-minimum/raw/45..50.diff | 4 ++-- .../static/diffs/template-bare-minimum/raw/46..50.diff | 4 ++-- .../static/diffs/template-bare-minimum/raw/47..50.diff | 4 ++-- .../static/diffs/template-bare-minimum/raw/48..50.diff | 4 ++-- .../static/diffs/template-bare-minimum/raw/49..50.diff | 4 ++-- .../diffs/template-bare-minimum/raw/50..unversioned.diff | 9 ++++++--- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/docs/public/static/diffs/template-bare-minimum/diffInfo.json b/docs/public/static/diffs/template-bare-minimum/diffInfo.json index a76e39e56a22d..9ca18821db0c8 100644 --- a/docs/public/static/diffs/template-bare-minimum/diffInfo.json +++ b/docs/public/static/diffs/template-bare-minimum/diffInfo.json @@ -1 +1 @@ -{"versions":["45","46","47","48","49","50","unversioned"],"diffs":{"45..45":"","45..46":"diff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex 346fb02564..f0293fe400 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -80,15 +80,17 @@ import org.apache.tools.ant.taskdefs.condition.Os\n \n def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()\n \n+def reactNativeRoot = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath()\n+\n project.ext.react = [\n entryFile: [\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\"].execute(null, rootDir).text.trim(),\n enableHermes: (findProperty('expo.jsEngine') ?: \"jsc\") == \"hermes\",\n- cliPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/cli.js\",\n- hermesCommand: new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/%OS-BIN%/hermesc\",\n- composeSourceMapsPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/scripts/compose-source-maps.js\",\n+ hermesCommand: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\",\n+ cliPath: \"${reactNativeRoot}/cli.js\",\n+ composeSourceMapsPath: \"${reactNativeRoot}/scripts/compose-source-maps.js\",\n ]\n \n-apply from: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../react.gradle\")\n+apply from: new File(reactNativeRoot, \"react.gradle\")\n \n /**\n * Set this to true to create two separate APKs instead of one:\n@@ -157,8 +159,9 @@ android {\n \"NDK_TOOLCHAIN_VERSION=clang\",\n \"GENERATED_SRC_DIR=$buildDir/generated/source\",\n \"PROJECT_BUILD_DIR=$buildDir\",\n- \"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid\",\n- \"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build\"\n+ \"REACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid\",\n+ \"REACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build\",\n+ \"NODE_MODULES_DIR=$rootDir/../node_modules\"\n cFlags \"-Wall\", \"-Werror\", \"-fexceptions\", \"-frtti\", \"-DWITH_INSPECTOR=1\"\n cppFlags \"-std=c++17\"\n // Make sure this target name is the same you specify inside the\n@@ -329,8 +332,10 @@ dependencies {\n }\n \n if (enableHermes) {\n- debugImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-debug.aar\"))\n- releaseImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-release.aar\"))\n+ //noinspection GradleDynamicVersion\n+ implementation(\"com.facebook.react:hermes-engine:+\") { // From node_modules\n+ exclude group:'com.facebook.fbjni'\n+ }\n } else {\n implementation jscFlavor\n }\n@@ -343,7 +348,11 @@ if (isNewArchitectureEnabled()) {\n configurations.all {\n resolutionStrategy.dependencySubstitution {\n substitute(module(\"com.facebook.react:react-native\"))\n- .using(project(\":ReactAndroid\")).because(\"On New Architecture we're building React Native from source\")\n+ .using(project(\":ReactAndroid\"))\n+ .because(\"On New Architecture we're building React Native from source\")\n+ substitute(module(\"com.facebook.react:hermes-engine\"))\n+ .using(project(\":ReactAndroid:hermes-engine\"))\n+ .because(\"On New Architecture we're building Hermes from source\")\n }\n }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 576e23db45..8e13797d9b 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -28,10 +28,15 @@ public class MainActivity extends ReactActivity {\n return \"main\";\n }\n \n+ /**\n+ * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n+ * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n+ * (Paper).\n+ */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ new MainActivityDelegate(this, getMainComponentName())\n );\n }\n \n@@ -54,4 +59,25 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n+\n+ public static class MainActivityDelegate extends ReactActivityDelegate {\n+ public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n+ super(activity, mainComponentName);\n+ }\n+\n+ @Override\n+ protected ReactRootView createRootView() {\n+ ReactRootView reactRootView = new ReactRootView(getContext());\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n+ return reactRootView;\n+ }\n+\n+ @Override\n+ protected boolean isConcurrentRootEnabled() {\n+ // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n+ // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+ }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\nindex f555e36448..7665dd923f 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n@@ -18,6 +18,7 @@ import com.facebook.react.fabric.ComponentFactory;\n import com.facebook.react.fabric.CoreComponentsRegistry;\n import com.facebook.react.fabric.EmptyReactNativeConfig;\n import com.facebook.react.fabric.FabricJSIModuleProvider;\n+import com.facebook.react.fabric.ReactNativeConfig;\n import com.facebook.react.uimanager.ViewManagerRegistry;\n import com.helloworld.BuildConfig;\n import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n@@ -105,7 +106,7 @@ public class MainApplicationReactNativeHost extends ReactNativeHost {\n return new FabricJSIModuleProvider(\n reactApplicationContext,\n componentFactory,\n- new EmptyReactNativeConfig(),\n+ ReactNativeConfig.DEFAULT_CONFIG,\n viewManagerRegistry);\n }\n });\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\nindex 0ae6366756..cda1391225 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n@@ -17,7 +17,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n \n # If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n+# will have to uncomment those lines to include the generated source\n # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n #\n # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n@@ -28,8 +28,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n LOCAL_SHARED_LIBRARIES := \\\n libfabricjni \\\n libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n+ libfolly_runtime \\\n libglog \\\n libjsi \\\n libreact_codegen_rncore \\\ndiff --git a/templates/expo-template-bare-minimum/android/build.gradle b/templates/expo-template-bare-minimum/android/build.gradle\nindex fa77528908..f259b31a11 100644\n--- a/templates/expo-template-bare-minimum/android/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/build.gradle\n@@ -1,7 +1,6 @@\n import org.apache.tools.ant.taskdefs.condition.Os\n \n // Top-level build file where you can add configuration options common to all sub-projects/modules.\n-\n buildscript {\n ext {\n buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'\n@@ -26,9 +25,9 @@ buildscript {\n mavenCentral()\n }\n dependencies {\n- classpath('com.android.tools.build:gradle:7.0.4')\n+ classpath('com.android.tools.build:gradle:7.1.1')\n classpath('com.facebook.react:react-native-gradle-plugin')\n- classpath('de.undercouch:gradle-download-task:4.1.2')\n+ classpath('de.undercouch:gradle-download-task:5.0.1')\n // NOTE: Do not place your application dependencies here; they belong\n // in the individual module build.gradle files\n }\n@@ -65,3 +64,9 @@ allprojects {\n maven { url 'https://www.jitpack.io' }\n }\n }\n+\n+configurations.all {\n+ resolutionStrategy {\n+ force 'com.facebook.react:react-native:0.69.6'\n+ }\n+}\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/settings.gradle b/templates/expo-template-bare-minimum/android/settings.gradle\nindex fa543f0c69..b3332319f9 100644\n--- a/templates/expo-template-bare-minimum/android/settings.gradle\n+++ b/templates/expo-template-bare-minimum/android/settings.gradle\n@@ -12,4 +12,6 @@ includeBuild(new File([\"node\", \"--print\", \"require.resolve('react-native-gradle-\n if (settings.hasProperty(\"newArchEnabled\") && settings.newArchEnabled == \"true\") {\n include(\":ReactAndroid\")\n project(\":ReactAndroid\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid\");\n+ include(\":ReactAndroid:hermes-engine\")\n+ project(\":ReactAndroid:hermes-engine\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid/hermes-engine\");\n }\ndiff --git a/templates/expo-template-bare-minimum/ios/.xcode.env b/templates/expo-template-bare-minimum/ios/.xcode.env\nnew file mode 100644\nindex 0000000000..3d5782c715\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/ios/.xcode.env\n@@ -0,0 +1,11 @@\n+# This `.xcode.env` file is versioned and is used to source the environment\n+# used when running script phases inside Xcode.\n+# To customize your local environment, you can create an `.xcode.env.local`\n+# file that is not versioned.\n+\n+# NODE_BINARY variable contains the PATH to the node executable.\n+#\n+# Customize the NODE_BINARY variable here.\n+# For example, to use nvm with brew, add the following line\n+# . \"$(brew --prefix nvm)/nvm.sh\" --no-use\n+export NODE_BINARY=$(command -v node)\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\nindex 2ac180e425..a4a049f05d 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n@@ -214,7 +214,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"export NODE_BINARY=node\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\n`node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n \t\t};\n \t\t08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {\n \t\t\tisa = PBXShellScriptBuildPhase;\n@@ -276,7 +276,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"export RCT_METRO_PORT=\\\"${RCT_METRO_PORT:=8081}\\\"\\necho \\\"export RCT_METRO_PORT=${RCT_METRO_PORT}\\\" > `node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\\\"`\\nif [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\\n if ! curl -s \\\"http://localhost:${RCT_METRO_PORT}/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n echo \\\"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\\\"\\n exit 2\\n fi\\n else\\n open `node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\\\"` || echo \\\"Can't start packager automatically\\\"\\n fi\\nfi\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\nexport RCT_METRO_PORT=\\\"${RCT_METRO_PORT:=8081}\\\"\\necho \\\"export RCT_METRO_PORT=${RCT_METRO_PORT}\\\" > `$NODE_BINARY --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\\\"`\\nif [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\\n if ! curl -s \\\"http://localhost:${RCT_METRO_PORT}/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n echo \\\"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\\\"\\n exit 2\\n fi\\n else\\n open `$NODE_BINARY --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\\\"` || echo \\\"Can't start packager automatically\\\"\\n fi\\nfi\\n\";\n \t\t\tshowEnvVarsInLog = 0;\n \t\t};\n /* End PBXShellScriptBuildPhase section */\n@@ -308,7 +308,7 @@\n \t\t\t\t\t\"FB_SONARKIT_ENABLED=1\",\n \t\t\t\t);\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n@@ -331,7 +331,7 @@\n \t\t\t\tCLANG_ENABLE_MODULES = YES;\n \t\t\t\tCURRENT_PROJECT_VERSION = 1;\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n@@ -392,7 +392,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n@@ -441,7 +441,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\nindex aef81ec589..a6e13e11ab 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n@@ -18,6 +18,8 @@\n \n #import \n \n+static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n+\n @interface AppDelegate () {\n RCTTurboModuleManager *_turboModuleManager;\n RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;\n@@ -43,7 +45,8 @@\n bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;\n #endif\n \n- UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:nil];\n+ NSDictionary *initProps = [self prepareInitialProps];\n+ UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:initProps];\n \n rootView.backgroundColor = [UIColor whiteColor];\n self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n@@ -63,6 +66,26 @@\n return @[];\n }\n \n+/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.\n+///\n+/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html\n+/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).\n+/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.\n+- (BOOL)concurrentRootEnabled\n+{\n+ // Switch this bool to turn on and off the concurrent root\n+ return true;\n+}\n+\n+- (NSDictionary *)prepareInitialProps\n+{\n+ NSMutableDictionary *initProps = [NSMutableDictionary new];\n+#if RCT_NEW_ARCH_ENABLED\n+ initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);\n+#endif\n+ return initProps;\n+}\n+\n - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n {\n #if DEBUG\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile b/templates/expo-template-bare-minimum/ios/Podfile\nindex 29797efaaa..91612acca9 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile\n+++ b/templates/expo-template-bare-minimum/ios/Podfile\n@@ -5,7 +5,7 @@ require File.join(File.dirname(`node --print \"require.resolve('@react-native-com\n require 'json'\n podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}\n \n-platform :ios, podfile_properties['ios.deploymentTarget'] || '12.0'\n+platform :ios, podfile_properties['ios.deploymentTarget'] || '12.4'\n install! 'cocoapods',\n :deterministic_uuids => false\n \n@@ -36,6 +36,17 @@ target 'HelloWorld' do\n post_install do |installer|\n react_native_post_install(installer)\n __apply_Xcode_12_5_M1_post_install_workaround(installer)\n+\n+ # This is necessary for Xcode 14, because it signs resource bundles by default\n+ # when building for devices.\n+ installer.target_installation_results.pod_target_installation_results\n+ .each do |pod_name, target_installation_result|\n+ target_installation_result.resource_bundle_targets.each do |resource_bundle_target|\n+ resource_bundle_target.build_configurations.each do |config|\n+ config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n+ end\n+ end\n+ end\n end\n \n post_integrate do |installer|\n@@ -45,5 +56,4 @@ target 'HelloWorld' do\n Pod::UI.warn e\n end\n end\n-\n end\ndiff --git a/templates/expo-template-bare-minimum/ios/gitignore b/templates/expo-template-bare-minimum/ios/gitignore\nindex 2b13519939..8beb344303 100644\n--- a/templates/expo-template-bare-minimum/ios/gitignore\n+++ b/templates/expo-template-bare-minimum/ios/gitignore\n@@ -21,6 +21,7 @@ DerivedData\n *.ipa\n *.xcuserstate\n project.xcworkspace\n+.xcode.env.local\n \n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json\nindex 69e7eb9619..d5ca09a584 100644\n--- a/templates/expo-template-bare-minimum/package.json\n+++ b/templates/expo-template-bare-minimum/package.json\n@@ -1,7 +1,7 @@\n {\n \"name\": \"expo-template-bare-minimum\",\n \"description\": \"This bare project template includes a minimal setup for using unimodules with React Native.\",\n- \"version\": \"45.0.6\",\n+ \"version\": \"46.0.37\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"expo start --dev-client\",\n@@ -10,13 +10,13 @@\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n- \"expo\": \"~45.0.0\",\n- \"expo-splash-screen\": \"~0.15.1\",\n- \"expo-status-bar\": \"~1.3.0\",\n- \"react\": \"17.0.2\",\n- \"react-dom\": \"17.0.2\",\n- \"react-native\": \"0.68.2\",\n- \"react-native-web\": \"0.17.7\"\n+ \"expo\": \"~46.0.21\",\n+ \"expo-splash-screen\": \"~0.16.2\",\n+ \"expo-status-bar\": \"~1.4.0\",\n+ \"react\": \"18.0.0\",\n+ \"react-dom\": \"18.0.0\",\n+ \"react-native\": \"0.69.9\",\n+ \"react-native-web\": \"~0.18.7\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.12.9\"\n","46..46":"","45..47":"diff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex 346fb02564..648135611c 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -1,7 +1,6 @@\n apply plugin: \"com.android.application\"\n \n import com.android.build.OutputFile\n-import org.apache.tools.ant.taskdefs.condition.Os\n \n /**\n * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n@@ -80,15 +79,17 @@ import org.apache.tools.ant.taskdefs.condition.Os\n \n def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()\n \n+def reactNativeRoot = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath()\n+\n project.ext.react = [\n entryFile: [\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\"].execute(null, rootDir).text.trim(),\n enableHermes: (findProperty('expo.jsEngine') ?: \"jsc\") == \"hermes\",\n- cliPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/cli.js\",\n- hermesCommand: new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/%OS-BIN%/hermesc\",\n- composeSourceMapsPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/scripts/compose-source-maps.js\",\n+ hermesCommand: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\",\n+ cliPath: \"${reactNativeRoot}/cli.js\",\n+ composeSourceMapsPath: \"${reactNativeRoot}/scripts/compose-source-maps.js\",\n ]\n \n-apply from: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../react.gradle\")\n+apply from: new File(reactNativeRoot, \"react.gradle\")\n \n /**\n * Set this to true to create two separate APKs instead of one:\n@@ -149,26 +150,14 @@ android {\n buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n \n if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n+ // We configure the CMake build only if you decide to opt-in for the New Architecture.\n externalNativeBuild {\n- ndkBuild {\n- arguments \"APP_PLATFORM=android-21\",\n- \"APP_STL=c++_shared\",\n- \"NDK_TOOLCHAIN_VERSION=clang\",\n- \"GENERATED_SRC_DIR=$buildDir/generated/source\",\n- \"PROJECT_BUILD_DIR=$buildDir\",\n- \"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid\",\n- \"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build\"\n- cFlags \"-Wall\", \"-Werror\", \"-fexceptions\", \"-frtti\", \"-DWITH_INSPECTOR=1\"\n- cppFlags \"-std=c++17\"\n- // Make sure this target name is the same you specify inside the\n- // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.\n- targets \"helloworld_appmodules\"\n-\n- // Fix for windows limit on number of character in file paths and in command lines\n- if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n- arguments \"NDK_APP_SHORT_COMMANDS=true\"\n- }\n+ cmake {\n+ arguments \"-DPROJECT_BUILD_DIR=$buildDir\",\n+ \"-DREACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid\",\n+ \"-DREACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build\",\n+ \"-DNODE_MODULES_DIR=$rootDir/../node_modules\",\n+ \"-DANDROID_STL=c++_shared\"\n }\n }\n if (!enableSeparateBuildPerCPUArchitecture) {\n@@ -180,10 +169,10 @@ android {\n }\n \n if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n+ // We configure the CMake build only if you decide to opt-in for the New Architecture.\n externalNativeBuild {\n- ndkBuild {\n- path \"$projectDir/src/main/jni/Android.mk\"\n+ cmake {\n+ path \"$projectDir/src/main/jni/CMakeLists.txt\"\n }\n }\n def reactAndroidProjectDir = project(':ReactAndroid').projectDir\n@@ -205,15 +194,15 @@ android {\n preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)\n \n // Due to a bug inside AGP, we have to explicitly set a dependency\n- // between configureNdkBuild* tasks and the preBuild tasks.\n+ // between configureCMakeDebug* tasks and the preBuild tasks.\n // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732\n- configureNdkBuildRelease.dependsOn(preReleaseBuild)\n- configureNdkBuildDebug.dependsOn(preDebugBuild)\n+ configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)\n+ configureCMakeDebug.dependsOn(preDebugBuild)\n reactNativeArchitectures().each { architecture ->\n- tasks.findByName(\"configureNdkBuildDebug[${architecture}]\")?.configure {\n+ tasks.findByName(\"configureCMakeDebug[${architecture}]\")?.configure {\n dependsOn(\"preDebugBuild\")\n }\n- tasks.findByName(\"configureNdkBuildRelease[${architecture}]\")?.configure {\n+ tasks.findByName(\"configureCMakeRelWithDebInfo[${architecture}]\")?.configure {\n dependsOn(\"preReleaseBuild\")\n }\n }\n@@ -329,8 +318,10 @@ dependencies {\n }\n \n if (enableHermes) {\n- debugImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-debug.aar\"))\n- releaseImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-release.aar\"))\n+ //noinspection GradleDynamicVersion\n+ implementation(\"com.facebook.react:hermes-engine:+\") { // From node_modules\n+ exclude group:'com.facebook.fbjni'\n+ }\n } else {\n implementation jscFlavor\n }\n@@ -343,7 +334,11 @@ if (isNewArchitectureEnabled()) {\n configurations.all {\n resolutionStrategy.dependencySubstitution {\n substitute(module(\"com.facebook.react:react-native\"))\n- .using(project(\":ReactAndroid\")).because(\"On New Architecture we're building React Native from source\")\n+ .using(project(\":ReactAndroid\"))\n+ .because(\"On New Architecture we're building React Native from source\")\n+ substitute(module(\"com.facebook.react:hermes-engine\"))\n+ .using(project(\":ReactAndroid:hermes-engine\"))\n+ .because(\"On New Architecture we're building Hermes from source\")\n }\n }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 576e23db45..8e13797d9b 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -28,10 +28,15 @@ public class MainActivity extends ReactActivity {\n return \"main\";\n }\n \n+ /**\n+ * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n+ * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n+ * (Paper).\n+ */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ new MainActivityDelegate(this, getMainComponentName())\n );\n }\n \n@@ -54,4 +59,25 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n+\n+ public static class MainActivityDelegate extends ReactActivityDelegate {\n+ public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n+ super(activity, mainComponentName);\n+ }\n+\n+ @Override\n+ protected ReactRootView createRootView() {\n+ ReactRootView reactRootView = new ReactRootView(getContext());\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n+ return reactRootView;\n+ }\n+\n+ @Override\n+ protected boolean isConcurrentRootEnabled() {\n+ // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n+ // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+ }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\nindex f555e36448..7665dd923f 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n@@ -18,6 +18,7 @@ import com.facebook.react.fabric.ComponentFactory;\n import com.facebook.react.fabric.CoreComponentsRegistry;\n import com.facebook.react.fabric.EmptyReactNativeConfig;\n import com.facebook.react.fabric.FabricJSIModuleProvider;\n+import com.facebook.react.fabric.ReactNativeConfig;\n import com.facebook.react.uimanager.ViewManagerRegistry;\n import com.helloworld.BuildConfig;\n import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n@@ -105,7 +106,7 @@ public class MainApplicationReactNativeHost extends ReactNativeHost {\n return new FabricJSIModuleProvider(\n reactApplicationContext,\n componentFactory,\n- new EmptyReactNativeConfig(),\n+ ReactNativeConfig.DEFAULT_CONFIG,\n viewManagerRegistry);\n }\n });\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex 0ae6366756..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,49 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\nnew file mode 100644\nindex 0000000000..d2cad3a326\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n@@ -0,0 +1,7 @@\n+cmake_minimum_required(VERSION 3.13)\n+\n+# Define the library name here.\n+project(helloworld_appmodules)\n+\n+# This file includes all the necessary to let you build your application with the New Architecture.\n+include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\nindex 0ac23cc626..26162dd872 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n@@ -1,12 +1,13 @@\n #include \"MainApplicationModuleProvider.h\"\n \n+#include \n #include \n \n namespace facebook {\n namespace react {\n \n std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n+ const std::string &moduleName,\n const JavaTurboModule::InitParams ¶ms) {\n // Here you can provide your own module provider for TurboModules coming from\n // either your application or from external libraries. The approach to follow\n@@ -17,6 +18,13 @@ std::shared_ptr MainApplicationModuleProvider(\n // return module;\n // }\n // return rncore_ModuleProvider(moduleName, params);\n+\n+ // Module providers autolinked by RN CLI\n+ auto rncli_module = rncli_ModuleProvider(moduleName, params);\n+ if (rncli_module != nullptr) {\n+ return rncli_module;\n+ }\n+\n return rncore_ModuleProvider(moduleName, params);\n }\n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\nindex 0fa43fa69a..b38ccf53fd 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n@@ -9,7 +9,7 @@ namespace facebook {\n namespace react {\n \n std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n+ const std::string &moduleName,\n const JavaTurboModule::InitParams ¶ms);\n \n } // namespace react\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\nindex dbbdc3d132..5fd688c509 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n@@ -22,21 +22,21 @@ void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n \n std::shared_ptr\n MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n+ const std::string &name,\n+ const std::shared_ptr &jsInvoker) {\n // Not implemented yet: provide pure-C++ NativeModules here.\n return nullptr;\n }\n \n std::shared_ptr\n MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n+ const std::string &name,\n const JavaTurboModule::InitParams ¶ms) {\n return MainApplicationModuleProvider(name, params);\n }\n \n bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n+ const std::string &name) {\n return getTurboModule(name, nullptr) != nullptr ||\n getTurboModule(name, {.moduleName = name}) != nullptr;\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\nindex 25f27722d0..9ee38a81f6 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n@@ -21,17 +21,17 @@ class MainApplicationTurboModuleManagerDelegate\n static void registerNatives();\n \n std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n+ const std::string &name,\n+ const std::shared_ptr &jsInvoker) override;\n std::shared_ptr getTurboModule(\n- const std::string name,\n+ const std::string &name,\n const JavaTurboModule::InitParams ¶ms) override;\n \n /**\n * Test-only method. Allows user to verify whether a TurboModule can be\n * created by instances of this class.\n */\n- bool canCreateTurboModule(std::string name);\n+ bool canCreateTurboModule(const std::string &name);\n };\n \n } // namespace react\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\nindex 8f7edffd64..54f598a486 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n@@ -4,6 +4,7 @@\n #include \n #include \n #include \n+#include \n \n namespace facebook {\n namespace react {\n@@ -14,6 +15,9 @@ std::shared_ptr\n MainComponentsRegistry::sharedProviderRegistry() {\n auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n \n+ // Autolinked providers registered by RN CLI\n+ rncli_registerProviders(providerRegistry);\n+\n // Custom Fabric Components go here. You can register custom\n // components coming from your App or from 3rd party libraries here.\n //\ndiff --git a/templates/expo-template-bare-minimum/android/build.gradle b/templates/expo-template-bare-minimum/android/build.gradle\nindex fa77528908..8181b282cd 100644\n--- a/templates/expo-template-bare-minimum/android/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/build.gradle\n@@ -1,5 +1,3 @@\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n // Top-level build file where you can add configuration options common to all sub-projects/modules.\n \n buildscript {\n@@ -26,15 +24,15 @@ buildscript {\n mavenCentral()\n }\n dependencies {\n- classpath('com.android.tools.build:gradle:7.0.4')\n+ classpath('com.android.tools.build:gradle:7.2.1')\n classpath('com.facebook.react:react-native-gradle-plugin')\n- classpath('de.undercouch:gradle-download-task:4.1.2')\n+ classpath('de.undercouch:gradle-download-task:5.0.1')\n // NOTE: Do not place your application dependencies here; they belong\n // in the individual module build.gradle files\n }\n }\n \n-def REACT_NATIVE_VERSION = new File(['node', '--print',\"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n+def REACT_NATIVE_VERSION = new File(['node', '--print', \"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n \n allprojects {\n configurations.all {\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar\nindex 7454180f2a..249e5832f0 100644\nBinary files a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar and b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar differ\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\nindex 669386b870..8fad3f5a98 100644\n--- a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n@@ -1,5 +1,5 @@\n distributionBase=GRADLE_USER_HOME\n distributionPath=wrapper/dists\n-distributionUrl=https\\://services.gradle.org/distributions/gradle-7.3.3-all.zip\n+distributionUrl=https\\://services.gradle.org/distributions/gradle-7.5.1-all.zip\n zipStoreBase=GRADLE_USER_HOME\n zipStorePath=wrapper/dists\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew b/templates/expo-template-bare-minimum/android/gradlew\nindex 1b6c787337..a69d9cb6c2 100755\n--- a/templates/expo-template-bare-minimum/android/gradlew\n+++ b/templates/expo-template-bare-minimum/android/gradlew\n@@ -205,6 +205,12 @@ set -- \\\n org.gradle.wrapper.GradleWrapperMain \\\n \"$@\"\n \n+# Stop when \"xargs\" is not available.\n+if ! command -v xargs >/dev/null 2>&1\n+then\n+ die \"xargs is not available\"\n+fi\n+\n # Use \"xargs\" to parse quoted args.\n #\n # With -n1 it outputs one arg per line, with the quotes and backslashes removed.\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew.bat b/templates/expo-template-bare-minimum/android/gradlew.bat\nindex ac1b06f938..53a6b238d4 100644\n--- a/templates/expo-template-bare-minimum/android/gradlew.bat\n+++ b/templates/expo-template-bare-minimum/android/gradlew.bat\n@@ -14,7 +14,7 @@\n @rem limitations under the License.\r\n @rem\r\n \r\n-@if \"%DEBUG%\" == \"\" @echo off\r\n+@if \"%DEBUG%\"==\"\" @echo off\r\n @rem ##########################################################################\r\n @rem\r\n @rem Gradle startup script for Windows\r\n@@ -25,7 +25,7 @@\n if \"%OS%\"==\"Windows_NT\" setlocal\r\n \r\n set DIRNAME=%~dp0\r\n-if \"%DIRNAME%\" == \"\" set DIRNAME=.\r\n+if \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n set APP_BASE_NAME=%~n0\r\n set APP_HOME=%DIRNAME%\r\n \r\n@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome\n \r\n set JAVA_EXE=java.exe\r\n %JAVA_EXE% -version >NUL 2>&1\r\n-if \"%ERRORLEVEL%\" == \"0\" goto execute\r\n+if %ERRORLEVEL% equ 0 goto execute\r\n \r\n echo.\r\n echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\n@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n \r\n :end\r\n @rem End local scope for the variables with windows NT shell\r\n-if \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n+if %ERRORLEVEL% equ 0 goto mainEnd\r\n \r\n :fail\r\n rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\n rem the _cmd.exe /c_ return code!\r\n-if not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\n-exit /b 1\r\n+set EXIT_CODE=%ERRORLEVEL%\r\n+if %EXIT_CODE% equ 0 set EXIT_CODE=1\r\n+if not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\n+exit /b %EXIT_CODE%\r\n \r\n :mainEnd\r\n if \"%OS%\"==\"Windows_NT\" endlocal\r\ndiff --git a/templates/expo-template-bare-minimum/android/settings.gradle b/templates/expo-template-bare-minimum/android/settings.gradle\nindex fa543f0c69..b3332319f9 100644\n--- a/templates/expo-template-bare-minimum/android/settings.gradle\n+++ b/templates/expo-template-bare-minimum/android/settings.gradle\n@@ -12,4 +12,6 @@ includeBuild(new File([\"node\", \"--print\", \"require.resolve('react-native-gradle-\n if (settings.hasProperty(\"newArchEnabled\") && settings.newArchEnabled == \"true\") {\n include(\":ReactAndroid\")\n project(\":ReactAndroid\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid\");\n+ include(\":ReactAndroid:hermes-engine\")\n+ project(\":ReactAndroid:hermes-engine\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid/hermes-engine\");\n }\ndiff --git a/templates/expo-template-bare-minimum/gitignore b/templates/expo-template-bare-minimum/gitignore\nindex c8eb0f9a64..67397f65f9 100644\n--- a/templates/expo-template-bare-minimum/gitignore\n+++ b/templates/expo-template-bare-minimum/gitignore\n@@ -30,6 +30,7 @@ build/\n local.properties\n *.iml\n *.hprof\n+.cxx/\n \n # node.js\n #\ndiff --git a/templates/expo-template-bare-minimum/ios/.xcode.env b/templates/expo-template-bare-minimum/ios/.xcode.env\nnew file mode 100644\nindex 0000000000..3d5782c715\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/ios/.xcode.env\n@@ -0,0 +1,11 @@\n+# This `.xcode.env` file is versioned and is used to source the environment\n+# used when running script phases inside Xcode.\n+# To customize your local environment, you can create an `.xcode.env.local`\n+# file that is not versioned.\n+\n+# NODE_BINARY variable contains the PATH to the node executable.\n+#\n+# Customize the NODE_BINARY variable here.\n+# For example, to use nvm with brew, add the following line\n+# . \"$(brew --prefix nvm)/nvm.sh\" --no-use\n+export NODE_BINARY=$(command -v node)\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\nindex 2ac180e425..62a1be2493 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n@@ -214,7 +214,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"export NODE_BINARY=node\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\n`node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\nif [[ -z \\\"$ENTRY_FILE\\\" ]]; then\\n # Set the entry JS file using the bundler's entry resolution.\\n export ENTRY_FILE=\\\"$(\\\"$NODE_BINARY\\\" -e \\\"require('expo/scripts/resolveAppEntry')\\\" $PROJECT_ROOT ios relative | tail -n 1)\\\"\\nfi\\n\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n \t\t};\n \t\t08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {\n \t\t\tisa = PBXShellScriptBuildPhase;\n@@ -276,7 +276,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"export RCT_METRO_PORT=\\\"${RCT_METRO_PORT:=8081}\\\"\\necho \\\"export RCT_METRO_PORT=${RCT_METRO_PORT}\\\" > `node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\\\"`\\nif [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\\n if ! curl -s \\\"http://localhost:${RCT_METRO_PORT}/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n echo \\\"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\\\"\\n exit 2\\n fi\\n else\\n open `node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\\\"` || echo \\\"Can't start packager automatically\\\"\\n fi\\nfi\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\nexport RCT_METRO_PORT=\\\"${RCT_METRO_PORT:=8081}\\\"\\necho \\\"export RCT_METRO_PORT=${RCT_METRO_PORT}\\\" > `$NODE_BINARY --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\\\"`\\nif [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\\n if ! curl -s \\\"http://localhost:${RCT_METRO_PORT}/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n echo \\\"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\\\"\\n exit 2\\n fi\\n else\\n open `$NODE_BINARY --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\\\"` || echo \\\"Can't start packager automatically\\\"\\n fi\\nfi\\n\";\n \t\t\tshowEnvVarsInLog = 0;\n \t\t};\n /* End PBXShellScriptBuildPhase section */\n@@ -308,7 +308,7 @@\n \t\t\t\t\t\"FB_SONARKIT_ENABLED=1\",\n \t\t\t\t);\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n@@ -331,7 +331,7 @@\n \t\t\t\tCLANG_ENABLE_MODULES = YES;\n \t\t\t\tCURRENT_PROJECT_VERSION = 1;\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n@@ -392,7 +392,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n@@ -441,7 +441,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\nindex aef81ec589..a6e13e11ab 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n@@ -18,6 +18,8 @@\n \n #import \n \n+static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n+\n @interface AppDelegate () {\n RCTTurboModuleManager *_turboModuleManager;\n RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;\n@@ -43,7 +45,8 @@\n bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;\n #endif\n \n- UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:nil];\n+ NSDictionary *initProps = [self prepareInitialProps];\n+ UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:initProps];\n \n rootView.backgroundColor = [UIColor whiteColor];\n self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n@@ -63,6 +66,26 @@\n return @[];\n }\n \n+/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.\n+///\n+/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html\n+/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).\n+/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.\n+- (BOOL)concurrentRootEnabled\n+{\n+ // Switch this bool to turn on and off the concurrent root\n+ return true;\n+}\n+\n+- (NSDictionary *)prepareInitialProps\n+{\n+ NSMutableDictionary *initProps = [NSMutableDictionary new];\n+#if RCT_NEW_ARCH_ENABLED\n+ initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);\n+#endif\n+ return initProps;\n+}\n+\n - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n {\n #if DEBUG\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile b/templates/expo-template-bare-minimum/ios/Podfile\nindex 29797efaaa..474455b90d 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile\n+++ b/templates/expo-template-bare-minimum/ios/Podfile\n@@ -5,7 +5,7 @@ require File.join(File.dirname(`node --print \"require.resolve('@react-native-com\n require 'json'\n podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}\n \n-platform :ios, podfile_properties['ios.deploymentTarget'] || '12.0'\n+platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'\n install! 'cocoapods',\n :deterministic_uuids => false\n \n@@ -20,22 +20,35 @@ target 'HelloWorld' do\n \n use_react_native!(\n :path => config[:reactNativePath],\n- :hermes_enabled => flags[:hermes_enabled] || podfile_properties['expo.jsEngine'] == 'hermes',\n+ :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes',\n :fabric_enabled => flags[:fabric_enabled],\n # An absolute path to your application root.\n- :app_path => \"#{Dir.pwd}/..\"\n+ :app_path => \"#{Pod::Config.instance.installation_root}/..\",\n+ #\n+ # Uncomment to opt-in to using Flipper\n+ # Note that if you have use_frameworks! enabled, Flipper will not work\n+ # :flipper_configuration => !ENV['CI'] ? FlipperConfiguration.enabled : FlipperConfiguration.disabled,\n )\n \n- # Uncomment to opt-in to using Flipper\n- # Note that if you have use_frameworks! enabled, Flipper will not work\n- #\n- # if !ENV['CI']\n- # use_flipper!()\n- # end\n-\n post_install do |installer|\n- react_native_post_install(installer)\n+ react_native_post_install(\n+ installer,\n+ # Set `mac_catalyst_enabled` to `true` in order to apply patches\n+ # necessary for Mac Catalyst builds\n+ :mac_catalyst_enabled => false\n+ )\n __apply_Xcode_12_5_M1_post_install_workaround(installer)\n+\n+ # This is necessary for Xcode 14, because it signs resource bundles by default\n+ # when building for devices.\n+ installer.target_installation_results.pod_target_installation_results\n+ .each do |pod_name, target_installation_result|\n+ target_installation_result.resource_bundle_targets.each do |resource_bundle_target|\n+ resource_bundle_target.build_configurations.each do |config|\n+ config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n+ end\n+ end\n+ end\n end\n \n post_integrate do |installer|\n@@ -45,5 +58,4 @@ target 'HelloWorld' do\n Pod::UI.warn e\n end\n end\n-\n end\ndiff --git a/templates/expo-template-bare-minimum/ios/gitignore b/templates/expo-template-bare-minimum/ios/gitignore\nindex 2b13519939..8beb344303 100644\n--- a/templates/expo-template-bare-minimum/ios/gitignore\n+++ b/templates/expo-template-bare-minimum/ios/gitignore\n@@ -21,6 +21,7 @@ DerivedData\n *.ipa\n *.xcuserstate\n project.xcworkspace\n+.xcode.env.local\n \n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json\nindex 69e7eb9619..a41fdc0d8d 100644\n--- a/templates/expo-template-bare-minimum/package.json\n+++ b/templates/expo-template-bare-minimum/package.json\n@@ -1,7 +1,7 @@\n {\n \"name\": \"expo-template-bare-minimum\",\n \"description\": \"This bare project template includes a minimal setup for using unimodules with React Native.\",\n- \"version\": \"45.0.6\",\n+ \"version\": \"47.0.26\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"expo start --dev-client\",\n@@ -10,13 +10,11 @@\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n- \"expo\": \"~45.0.0\",\n- \"expo-splash-screen\": \"~0.15.1\",\n- \"expo-status-bar\": \"~1.3.0\",\n- \"react\": \"17.0.2\",\n- \"react-dom\": \"17.0.2\",\n- \"react-native\": \"0.68.2\",\n- \"react-native-web\": \"0.17.7\"\n+ \"expo\": \"~47.0.14\",\n+ \"expo-splash-screen\": \"~0.17.5\",\n+ \"expo-status-bar\": \"~1.4.2\",\n+ \"react\": \"18.1.0\",\n+ \"react-native\": \"0.70.8\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.12.9\"\n","46..47":"diff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex f0293fe400..648135611c 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -1,7 +1,6 @@\n apply plugin: \"com.android.application\"\n \n import com.android.build.OutputFile\n-import org.apache.tools.ant.taskdefs.condition.Os\n \n /**\n * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n@@ -151,27 +150,14 @@ android {\n buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n \n if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n+ // We configure the CMake build only if you decide to opt-in for the New Architecture.\n externalNativeBuild {\n- ndkBuild {\n- arguments \"APP_PLATFORM=android-21\",\n- \"APP_STL=c++_shared\",\n- \"NDK_TOOLCHAIN_VERSION=clang\",\n- \"GENERATED_SRC_DIR=$buildDir/generated/source\",\n- \"PROJECT_BUILD_DIR=$buildDir\",\n- \"REACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid\",\n- \"REACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build\",\n- \"NODE_MODULES_DIR=$rootDir/../node_modules\"\n- cFlags \"-Wall\", \"-Werror\", \"-fexceptions\", \"-frtti\", \"-DWITH_INSPECTOR=1\"\n- cppFlags \"-std=c++17\"\n- // Make sure this target name is the same you specify inside the\n- // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.\n- targets \"helloworld_appmodules\"\n-\n- // Fix for windows limit on number of character in file paths and in command lines\n- if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n- arguments \"NDK_APP_SHORT_COMMANDS=true\"\n- }\n+ cmake {\n+ arguments \"-DPROJECT_BUILD_DIR=$buildDir\",\n+ \"-DREACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid\",\n+ \"-DREACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build\",\n+ \"-DNODE_MODULES_DIR=$rootDir/../node_modules\",\n+ \"-DANDROID_STL=c++_shared\"\n }\n }\n if (!enableSeparateBuildPerCPUArchitecture) {\n@@ -183,10 +169,10 @@ android {\n }\n \n if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n+ // We configure the CMake build only if you decide to opt-in for the New Architecture.\n externalNativeBuild {\n- ndkBuild {\n- path \"$projectDir/src/main/jni/Android.mk\"\n+ cmake {\n+ path \"$projectDir/src/main/jni/CMakeLists.txt\"\n }\n }\n def reactAndroidProjectDir = project(':ReactAndroid').projectDir\n@@ -208,15 +194,15 @@ android {\n preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)\n \n // Due to a bug inside AGP, we have to explicitly set a dependency\n- // between configureNdkBuild* tasks and the preBuild tasks.\n+ // between configureCMakeDebug* tasks and the preBuild tasks.\n // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732\n- configureNdkBuildRelease.dependsOn(preReleaseBuild)\n- configureNdkBuildDebug.dependsOn(preDebugBuild)\n+ configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)\n+ configureCMakeDebug.dependsOn(preDebugBuild)\n reactNativeArchitectures().each { architecture ->\n- tasks.findByName(\"configureNdkBuildDebug[${architecture}]\")?.configure {\n+ tasks.findByName(\"configureCMakeDebug[${architecture}]\")?.configure {\n dependsOn(\"preDebugBuild\")\n }\n- tasks.findByName(\"configureNdkBuildRelease[${architecture}]\")?.configure {\n+ tasks.findByName(\"configureCMakeRelWithDebInfo[${architecture}]\")?.configure {\n dependsOn(\"preReleaseBuild\")\n }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex cda1391225..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source\n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_runtime \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\nnew file mode 100644\nindex 0000000000..d2cad3a326\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n@@ -0,0 +1,7 @@\n+cmake_minimum_required(VERSION 3.13)\n+\n+# Define the library name here.\n+project(helloworld_appmodules)\n+\n+# This file includes all the necessary to let you build your application with the New Architecture.\n+include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\nindex 0ac23cc626..26162dd872 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n@@ -1,12 +1,13 @@\n #include \"MainApplicationModuleProvider.h\"\n \n+#include \n #include \n \n namespace facebook {\n namespace react {\n \n std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n+ const std::string &moduleName,\n const JavaTurboModule::InitParams ¶ms) {\n // Here you can provide your own module provider for TurboModules coming from\n // either your application or from external libraries. The approach to follow\n@@ -17,6 +18,13 @@ std::shared_ptr MainApplicationModuleProvider(\n // return module;\n // }\n // return rncore_ModuleProvider(moduleName, params);\n+\n+ // Module providers autolinked by RN CLI\n+ auto rncli_module = rncli_ModuleProvider(moduleName, params);\n+ if (rncli_module != nullptr) {\n+ return rncli_module;\n+ }\n+\n return rncore_ModuleProvider(moduleName, params);\n }\n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\nindex 0fa43fa69a..b38ccf53fd 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n@@ -9,7 +9,7 @@ namespace facebook {\n namespace react {\n \n std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n+ const std::string &moduleName,\n const JavaTurboModule::InitParams ¶ms);\n \n } // namespace react\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\nindex dbbdc3d132..5fd688c509 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n@@ -22,21 +22,21 @@ void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n \n std::shared_ptr\n MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n+ const std::string &name,\n+ const std::shared_ptr &jsInvoker) {\n // Not implemented yet: provide pure-C++ NativeModules here.\n return nullptr;\n }\n \n std::shared_ptr\n MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n+ const std::string &name,\n const JavaTurboModule::InitParams ¶ms) {\n return MainApplicationModuleProvider(name, params);\n }\n \n bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n+ const std::string &name) {\n return getTurboModule(name, nullptr) != nullptr ||\n getTurboModule(name, {.moduleName = name}) != nullptr;\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\nindex 25f27722d0..9ee38a81f6 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n@@ -21,17 +21,17 @@ class MainApplicationTurboModuleManagerDelegate\n static void registerNatives();\n \n std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n+ const std::string &name,\n+ const std::shared_ptr &jsInvoker) override;\n std::shared_ptr getTurboModule(\n- const std::string name,\n+ const std::string &name,\n const JavaTurboModule::InitParams ¶ms) override;\n \n /**\n * Test-only method. Allows user to verify whether a TurboModule can be\n * created by instances of this class.\n */\n- bool canCreateTurboModule(std::string name);\n+ bool canCreateTurboModule(const std::string &name);\n };\n \n } // namespace react\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\nindex 8f7edffd64..54f598a486 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n@@ -4,6 +4,7 @@\n #include \n #include \n #include \n+#include \n \n namespace facebook {\n namespace react {\n@@ -14,6 +15,9 @@ std::shared_ptr\n MainComponentsRegistry::sharedProviderRegistry() {\n auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n \n+ // Autolinked providers registered by RN CLI\n+ rncli_registerProviders(providerRegistry);\n+\n // Custom Fabric Components go here. You can register custom\n // components coming from your App or from 3rd party libraries here.\n //\ndiff --git a/templates/expo-template-bare-minimum/android/build.gradle b/templates/expo-template-bare-minimum/android/build.gradle\nindex f259b31a11..8181b282cd 100644\n--- a/templates/expo-template-bare-minimum/android/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/build.gradle\n@@ -1,6 +1,5 @@\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n // Top-level build file where you can add configuration options common to all sub-projects/modules.\n+\n buildscript {\n ext {\n buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'\n@@ -25,7 +24,7 @@ buildscript {\n mavenCentral()\n }\n dependencies {\n- classpath('com.android.tools.build:gradle:7.1.1')\n+ classpath('com.android.tools.build:gradle:7.2.1')\n classpath('com.facebook.react:react-native-gradle-plugin')\n classpath('de.undercouch:gradle-download-task:5.0.1')\n // NOTE: Do not place your application dependencies here; they belong\n@@ -33,7 +32,7 @@ buildscript {\n }\n }\n \n-def REACT_NATIVE_VERSION = new File(['node', '--print',\"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n+def REACT_NATIVE_VERSION = new File(['node', '--print', \"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n \n allprojects {\n configurations.all {\n@@ -64,9 +63,3 @@ allprojects {\n maven { url 'https://www.jitpack.io' }\n }\n }\n-\n-configurations.all {\n- resolutionStrategy {\n- force 'com.facebook.react:react-native:0.69.6'\n- }\n-}\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar\nindex 7454180f2a..249e5832f0 100644\nBinary files a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar and b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar differ\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\nindex 669386b870..8fad3f5a98 100644\n--- a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n@@ -1,5 +1,5 @@\n distributionBase=GRADLE_USER_HOME\n distributionPath=wrapper/dists\n-distributionUrl=https\\://services.gradle.org/distributions/gradle-7.3.3-all.zip\n+distributionUrl=https\\://services.gradle.org/distributions/gradle-7.5.1-all.zip\n zipStoreBase=GRADLE_USER_HOME\n zipStorePath=wrapper/dists\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew b/templates/expo-template-bare-minimum/android/gradlew\nindex 1b6c787337..a69d9cb6c2 100755\n--- a/templates/expo-template-bare-minimum/android/gradlew\n+++ b/templates/expo-template-bare-minimum/android/gradlew\n@@ -205,6 +205,12 @@ set -- \\\n org.gradle.wrapper.GradleWrapperMain \\\n \"$@\"\n \n+# Stop when \"xargs\" is not available.\n+if ! command -v xargs >/dev/null 2>&1\n+then\n+ die \"xargs is not available\"\n+fi\n+\n # Use \"xargs\" to parse quoted args.\n #\n # With -n1 it outputs one arg per line, with the quotes and backslashes removed.\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew.bat b/templates/expo-template-bare-minimum/android/gradlew.bat\nindex ac1b06f938..53a6b238d4 100644\n--- a/templates/expo-template-bare-minimum/android/gradlew.bat\n+++ b/templates/expo-template-bare-minimum/android/gradlew.bat\n@@ -14,7 +14,7 @@\n @rem limitations under the License.\r\n @rem\r\n \r\n-@if \"%DEBUG%\" == \"\" @echo off\r\n+@if \"%DEBUG%\"==\"\" @echo off\r\n @rem ##########################################################################\r\n @rem\r\n @rem Gradle startup script for Windows\r\n@@ -25,7 +25,7 @@\n if \"%OS%\"==\"Windows_NT\" setlocal\r\n \r\n set DIRNAME=%~dp0\r\n-if \"%DIRNAME%\" == \"\" set DIRNAME=.\r\n+if \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n set APP_BASE_NAME=%~n0\r\n set APP_HOME=%DIRNAME%\r\n \r\n@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome\n \r\n set JAVA_EXE=java.exe\r\n %JAVA_EXE% -version >NUL 2>&1\r\n-if \"%ERRORLEVEL%\" == \"0\" goto execute\r\n+if %ERRORLEVEL% equ 0 goto execute\r\n \r\n echo.\r\n echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\n@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n \r\n :end\r\n @rem End local scope for the variables with windows NT shell\r\n-if \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n+if %ERRORLEVEL% equ 0 goto mainEnd\r\n \r\n :fail\r\n rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\n rem the _cmd.exe /c_ return code!\r\n-if not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\n-exit /b 1\r\n+set EXIT_CODE=%ERRORLEVEL%\r\n+if %EXIT_CODE% equ 0 set EXIT_CODE=1\r\n+if not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\n+exit /b %EXIT_CODE%\r\n \r\n :mainEnd\r\n if \"%OS%\"==\"Windows_NT\" endlocal\r\ndiff --git a/templates/expo-template-bare-minimum/gitignore b/templates/expo-template-bare-minimum/gitignore\nindex c8eb0f9a64..67397f65f9 100644\n--- a/templates/expo-template-bare-minimum/gitignore\n+++ b/templates/expo-template-bare-minimum/gitignore\n@@ -30,6 +30,7 @@ build/\n local.properties\n *.iml\n *.hprof\n+.cxx/\n \n # node.js\n #\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\nindex a4a049f05d..62a1be2493 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n@@ -214,7 +214,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\nif [[ -z \\\"$ENTRY_FILE\\\" ]]; then\\n # Set the entry JS file using the bundler's entry resolution.\\n export ENTRY_FILE=\\\"$(\\\"$NODE_BINARY\\\" -e \\\"require('expo/scripts/resolveAppEntry')\\\" $PROJECT_ROOT ios relative | tail -n 1)\\\"\\nfi\\n\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n \t\t};\n \t\t08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {\n \t\t\tisa = PBXShellScriptBuildPhase;\n@@ -308,7 +308,7 @@\n \t\t\t\t\t\"FB_SONARKIT_ENABLED=1\",\n \t\t\t\t);\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n@@ -331,7 +331,7 @@\n \t\t\t\tCLANG_ENABLE_MODULES = YES;\n \t\t\t\tCURRENT_PROJECT_VERSION = 1;\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n@@ -392,7 +392,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n@@ -441,7 +441,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile b/templates/expo-template-bare-minimum/ios/Podfile\nindex 91612acca9..474455b90d 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile\n+++ b/templates/expo-template-bare-minimum/ios/Podfile\n@@ -5,7 +5,7 @@ require File.join(File.dirname(`node --print \"require.resolve('@react-native-com\n require 'json'\n podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}\n \n-platform :ios, podfile_properties['ios.deploymentTarget'] || '12.4'\n+platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'\n install! 'cocoapods',\n :deterministic_uuids => false\n \n@@ -20,21 +20,23 @@ target 'HelloWorld' do\n \n use_react_native!(\n :path => config[:reactNativePath],\n- :hermes_enabled => flags[:hermes_enabled] || podfile_properties['expo.jsEngine'] == 'hermes',\n+ :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes',\n :fabric_enabled => flags[:fabric_enabled],\n # An absolute path to your application root.\n- :app_path => \"#{Dir.pwd}/..\"\n+ :app_path => \"#{Pod::Config.instance.installation_root}/..\",\n+ #\n+ # Uncomment to opt-in to using Flipper\n+ # Note that if you have use_frameworks! enabled, Flipper will not work\n+ # :flipper_configuration => !ENV['CI'] ? FlipperConfiguration.enabled : FlipperConfiguration.disabled,\n )\n \n- # Uncomment to opt-in to using Flipper\n- # Note that if you have use_frameworks! enabled, Flipper will not work\n- #\n- # if !ENV['CI']\n- # use_flipper!()\n- # end\n-\n post_install do |installer|\n- react_native_post_install(installer)\n+ react_native_post_install(\n+ installer,\n+ # Set `mac_catalyst_enabled` to `true` in order to apply patches\n+ # necessary for Mac Catalyst builds\n+ :mac_catalyst_enabled => false\n+ )\n __apply_Xcode_12_5_M1_post_install_workaround(installer)\n \n # This is necessary for Xcode 14, because it signs resource bundles by default\ndiff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json\nindex d5ca09a584..a41fdc0d8d 100644\n--- a/templates/expo-template-bare-minimum/package.json\n+++ b/templates/expo-template-bare-minimum/package.json\n@@ -1,7 +1,7 @@\n {\n \"name\": \"expo-template-bare-minimum\",\n \"description\": \"This bare project template includes a minimal setup for using unimodules with React Native.\",\n- \"version\": \"46.0.37\",\n+ \"version\": \"47.0.26\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"expo start --dev-client\",\n@@ -10,13 +10,11 @@\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n- \"expo\": \"~46.0.21\",\n- \"expo-splash-screen\": \"~0.16.2\",\n- \"expo-status-bar\": \"~1.4.0\",\n- \"react\": \"18.0.0\",\n- \"react-dom\": \"18.0.0\",\n- \"react-native\": \"0.69.9\",\n- \"react-native-web\": \"~0.18.7\"\n+ \"expo\": \"~47.0.14\",\n+ \"expo-splash-screen\": \"~0.17.5\",\n+ \"expo-status-bar\": \"~1.4.2\",\n+ \"react\": \"18.1.0\",\n+ \"react-native\": \"0.70.8\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.12.9\"\n","47..47":"","45..48":"diff --git a/templates/expo-template-bare-minimum/.buckconfig b/templates/expo-template-bare-minimum/.buckconfig\ndeleted file mode 100644\nindex 934256cb29..0000000000\n--- a/templates/expo-template-bare-minimum/.buckconfig\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-\n-[android]\n- target = Google Inc.:Google APIs:23\n-\n-[maven_repositories]\n- central = https://repo1.maven.org/maven2\ndiff --git a/templates/expo-template-bare-minimum/.npmignore b/templates/expo-template-bare-minimum/.npmignore\nindex 35490b6612..4e6ce00391 100644\n--- a/templates/expo-template-bare-minimum/.npmignore\n+++ b/templates/expo-template-bare-minimum/.npmignore\n@@ -20,3 +20,4 @@ ios/Pods\n android/.build\n android/app/build\n android/.gradle\n+ios/.xcode.env.local\ndiff --git a/templates/expo-template-bare-minimum/android/app/BUCK b/templates/expo-template-bare-minimum/android/app/BUCK\ndeleted file mode 100644\nindex 0e77904834..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/BUCK\n+++ /dev/null\n@@ -1,55 +0,0 @@\n-# To learn about Buck see [Docs](https://buckbuild.com/).\n-# To run your application with Buck:\n-# - install Buck\n-# - `npm start` - to start the packager\n-# - `cd android`\n-# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\"`\n-# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck\n-# - `buck install -r android/app` - compile, install and run application\n-#\n-\n-load(\":build_defs.bzl\", \"create_aar_targets\", \"create_jar_targets\")\n-\n-lib_deps = []\n-\n-create_aar_targets(glob([\"libs/*.aar\"]))\n-\n-create_jar_targets(glob([\"libs/*.jar\"]))\n-\n-android_library(\n- name = \"all-libs\",\n- exported_deps = lib_deps,\n-)\n-\n-android_library(\n- name = \"app-code\",\n- srcs = glob([\n- \"src/main/java/**/*.java\",\n- ]),\n- deps = [\n- \":all-libs\",\n- \":build_config\",\n- \":res\",\n- ],\n-)\n-\n-android_build_config(\n- name = \"build_config\",\n- package = \"com.helloworld\",\n-)\n-\n-android_resource(\n- name = \"res\",\n- package = \"com.helloworld\",\n- res = \"src/main/res\",\n-)\n-\n-android_binary(\n- name = \"app\",\n- keystore = \"//android/keystores:debug\",\n- manifest = \"src/main/AndroidManifest.xml\",\n- package_type = \"debug\",\n- deps = [\n- \":app-code\",\n- ],\n-)\ndiff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex 346fb02564..189390e7e3 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -1,134 +1,107 @@\n apply plugin: \"com.android.application\"\n+apply plugin: \"com.facebook.react\"\n \n import com.android.build.OutputFile\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n-/**\n- * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n- * and bundleReleaseJsAndAssets).\n- * These basically call `react-native bundle` with the correct arguments during the Android build\n- * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the\n- * bundle directly from the development server. Below you can see all the possible configurations\n- * and their defaults. If you decide to add a configuration block, make sure to add it before the\n- * `apply from: \"../../node_modules/react-native/react.gradle\"` line.\n- *\n- * project.ext.react = [\n- * // the name of the generated asset file containing your JS bundle\n- * bundleAssetName: \"index.android.bundle\",\n- *\n- * // the entry file for bundle generation. If none specified and\n- * // \"index.android.js\" exists, it will be used. Otherwise \"index.js\" is\n- * // default. Can be overridden with ENTRY_FILE environment variable.\n- * entryFile: \"index.android.js\",\n- *\n- * // https://reactnative.dev/docs/performance#enable-the-ram-format\n- * bundleCommand: \"ram-bundle\",\n- *\n- * // whether to bundle JS and assets in debug mode\n- * bundleInDebug: false,\n- *\n- * // whether to bundle JS and assets in release mode\n- * bundleInRelease: true,\n- *\n- * // whether to bundle JS and assets in another build variant (if configured).\n- * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants\n- * // The configuration property can be in the following formats\n- * // 'bundleIn${productFlavor}${buildType}'\n- * // 'bundleIn${buildType}'\n- * // bundleInFreeDebug: true,\n- * // bundleInPaidRelease: true,\n- * // bundleInBeta: true,\n- *\n- * // whether to disable dev mode in custom build variants (by default only disabled in release)\n- * // for example: to disable dev mode in the staging build type (if configured)\n- * devDisabledInStaging: true,\n- * // The configuration property can be in the following formats\n- * // 'devDisabledIn${productFlavor}${buildType}'\n- * // 'devDisabledIn${buildType}'\n- *\n- * // the root of your project, i.e. where \"package.json\" lives\n- * root: \"../../\",\n- *\n- * // where to put the JS bundle asset in debug mode\n- * jsBundleDirDebug: \"$buildDir/intermediates/assets/debug\",\n- *\n- * // where to put the JS bundle asset in release mode\n- * jsBundleDirRelease: \"$buildDir/intermediates/assets/release\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in debug mode\n- * resourcesDirDebug: \"$buildDir/intermediates/res/merged/debug\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in release mode\n- * resourcesDirRelease: \"$buildDir/intermediates/res/merged/release\",\n- *\n- * // by default the gradle tasks are skipped if none of the JS files or assets change; this means\n- * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to\n- * // date; if you have any other folders that you want to ignore for performance reasons (gradle\n- * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/\n- * // for example, you might want to remove it from here.\n- * inputExcludes: [\"android/**\", \"ios/**\"],\n- *\n- * // override which node gets called and with what additional arguments\n- * nodeExecutableAndArgs: [\"node\"],\n- *\n- * // supply additional arguments to the packager\n- * extraPackagerArgs: []\n- * ]\n- */\n \n def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()\n+def expoDebuggableVariants = ['debug']\n+// Override `debuggableVariants` for expo-updates debugging\n+if (System.getenv('EX_UPDATES_NATIVE_DEBUG') == \"1\") {\n+ react {\n+ expoDebuggableVariants = []\n+ }\n+}\n \n-project.ext.react = [\n- entryFile: [\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\"].execute(null, rootDir).text.trim(),\n- enableHermes: (findProperty('expo.jsEngine') ?: \"jsc\") == \"hermes\",\n- cliPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/cli.js\",\n- hermesCommand: new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/%OS-BIN%/hermesc\",\n- composeSourceMapsPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/scripts/compose-source-maps.js\",\n-]\n \n-apply from: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../react.gradle\")\n+/**\n+ * This is the configuration block to customize your React Native Android app.\n+ * By default you don't need to apply any configuration, just uncomment the lines you need.\n+ */\n+react {\n+ entryFile = file([\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\", \"absolute\"].execute(null, rootDir).text.trim())\n+ reactNativeDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()\n+ hermesCommand = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\"\n+ debuggableVariants = expoDebuggableVariants\n+\n+ /* Folders */\n+ // The root of your project, i.e. where \"package.json\" lives. Default is '..'\n+ // root = file(\"../\")\n+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native\n+ // reactNativeDir = file(\"../node_modules/react-native\")\n+ // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen\n+ // codegenDir = file(\"../node_modules/react-native-codegen\")\n+ // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js\n+ // cliFile = file(\"../node_modules/react-native/cli.js\")\n+\n+ /* Variants */\n+ // The list of variants to that are debuggable. For those we're going to\n+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.\n+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.\n+ // debuggableVariants = [\"liteDebug\", \"prodDebug\"]\n+\n+ /* Bundling */\n+ // A list containing the node command and its flags. Default is just 'node'.\n+ // nodeExecutableAndArgs = [\"node\"]\n+ //\n+ // The command to run when bundling. By default is 'bundle'\n+ // bundleCommand = \"ram-bundle\"\n+ //\n+ // The path to the CLI configuration file. Default is empty.\n+ // bundleConfig = file(../rn-cli.config.js)\n+ //\n+ // The name of the generated asset file containing your JS bundle\n+ // bundleAssetName = \"MyApplication.android.bundle\"\n+ //\n+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'\n+ // entryFile = file(\"../js/MyApplication.android.js\")\n+ //\n+ // A list of extra flags to pass to the 'bundle' commands.\n+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle\n+ // extraPackagerArgs = []\n+\n+ /* Hermes Commands */\n+ // The hermes compiler command to run. By default it is 'hermesc'\n+ // hermesCommand = \"$rootDir/my-custom-hermesc/bin/hermesc\"\n+ //\n+ // The list of flags to pass to the Hermes compiler. By default is \"-O\", \"-output-source-map\"\n+ // hermesFlags = [\"-O\", \"-output-source-map\"]\n+}\n+\n+// Override `hermesEnabled` by `expo.jsEngine`\n+ext {\n+ hermesEnabled = (findProperty('expo.jsEngine') ?: \"hermes\") == \"hermes\"\n+}\n \n /**\n- * Set this to true to create two separate APKs instead of one:\n- * - An APK that only works on ARM devices\n- * - An APK that only works on x86 devices\n- * The advantage is the size of the APK is reduced by about 4MB.\n- * Upload all the APKs to the Play Store and people will download\n- * the correct one based on the CPU architecture of their device.\n+ * Set this to true to create four separate APKs instead of one,\n+ * one for each native architecture. This is useful if you don't\n+ * use App Bundles (https://developer.android.com/guide/app-bundle/)\n+ * and want to have separate APKs to upload to the Play Store.\n */\n def enableSeparateBuildPerCPUArchitecture = false\n \n /**\n- * Run Proguard to shrink the Java bytecode in release builds.\n+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.\n */\n def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()\n \n /**\n- * The preferred build flavor of JavaScriptCore.\n+ * The preferred build flavor of JavaScriptCore (JSC)\n *\n * For example, to use the international variant, you can use:\n * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`\n *\n * The international variant includes ICU i18n library and necessary data\n * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that\n- * give correct results when using with locales other than en-US. Note that\n+ * give correct results when using with locales other than en-US. Note that\n * this variant is about 6MiB larger per architecture than default.\n */\n def jscFlavor = 'org.webkit:android-jsc:+'\n \n /**\n- * Whether to enable the Hermes VM.\n- *\n- * This should be set on project.ext.react and that value will be read here. If it is not set\n- * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode\n- * and the benefits of using Hermes will therefore be sharply reduced.\n- */\n-def enableHermes = project.ext.react.get(\"enableHermes\", false);\n-\n-/**\n- * Architectures to build native code for.\n+ * Private function to get the list of Native Architectures you want to build.\n+ * This reads the value from reactNativeArchitectures in your gradle.properties\n+ * file and works together with the --active-arch-only flag of react-native run-android.\n */\n def reactNativeArchitectures() {\n def value = project.getProperties().get(\"reactNativeArchitectures\")\n@@ -140,84 +113,13 @@ android {\n \n compileSdkVersion rootProject.ext.compileSdkVersion\n \n+ namespace \"com.helloworld\"\n defaultConfig {\n applicationId \"com.helloworld\"\n minSdkVersion rootProject.ext.minSdkVersion\n targetSdkVersion rootProject.ext.targetSdkVersion\n versionCode 1\n versionName \"1.0\"\n- buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- arguments \"APP_PLATFORM=android-21\",\n- \"APP_STL=c++_shared\",\n- \"NDK_TOOLCHAIN_VERSION=clang\",\n- \"GENERATED_SRC_DIR=$buildDir/generated/source\",\n- \"PROJECT_BUILD_DIR=$buildDir\",\n- \"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid\",\n- \"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build\"\n- cFlags \"-Wall\", \"-Werror\", \"-fexceptions\", \"-frtti\", \"-DWITH_INSPECTOR=1\"\n- cppFlags \"-std=c++17\"\n- // Make sure this target name is the same you specify inside the\n- // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.\n- targets \"helloworld_appmodules\"\n-\n- // Fix for windows limit on number of character in file paths and in command lines\n- if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n- arguments \"NDK_APP_SHORT_COMMANDS=true\"\n- }\n- }\n- }\n- if (!enableSeparateBuildPerCPUArchitecture) {\n- ndk {\n- abiFilters (*reactNativeArchitectures())\n- }\n- }\n- }\n- }\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- path \"$projectDir/src/main/jni/Android.mk\"\n- }\n- }\n- def reactAndroidProjectDir = project(':ReactAndroid').projectDir\n- def packageReactNdkDebugLibs = tasks.register(\"packageReactNdkDebugLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkDebugLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- def packageReactNdkReleaseLibs = tasks.register(\"packageReactNdkReleaseLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkReleaseLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- afterEvaluate {\n- // If you wish to add a custom TurboModule or component locally,\n- // you should uncomment this line.\n- // preBuild.dependsOn(\"generateCodegenArtifactsFromSchema\")\n- preDebugBuild.dependsOn(packageReactNdkDebugLibs)\n- preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)\n-\n- // Due to a bug inside AGP, we have to explicitly set a dependency\n- // between configureNdkBuild* tasks and the preBuild tasks.\n- // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732\n- configureNdkBuildRelease.dependsOn(preReleaseBuild)\n- configureNdkBuildDebug.dependsOn(preDebugBuild)\n- reactNativeArchitectures().each { architecture ->\n- tasks.findByName(\"configureNdkBuildDebug[${architecture}]\")?.configure {\n- dependsOn(\"preDebugBuild\")\n- }\n- tasks.findByName(\"configureNdkBuildRelease[${architecture}]\")?.configure {\n- dependsOn(\"preReleaseBuild\")\n- }\n- }\n- }\n }\n \n splits {\n@@ -244,6 +146,7 @@ android {\n // Caution! In production, you need to generate your own keystore file.\n // see https://reactnative.dev/docs/signed-apk-android.\n signingConfig signingConfigs.debug\n+ shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)\n minifyEnabled enableProguardInReleaseBuilds\n proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n }\n@@ -254,11 +157,12 @@ android {\n variant.outputs.each { output ->\n // For each separate APK per architecture, set a unique version code as described here:\n // https://developer.android.com/studio/build/configure-apk-splits.html\n+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.\n def versionCodes = [\"armeabi-v7a\": 1, \"x86\": 2, \"arm64-v8a\": 3, \"x86_64\": 4]\n def abi = output.getFilter(OutputFile.ABI)\n if (abi != null) { // null for the universal-debug, universal-release variants\n output.versionCodeOverride =\n- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)\n }\n \n }\n@@ -286,10 +190,8 @@ android {\n }\n \n dependencies {\n- implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n-\n- //noinspection GradleDynamicVersion\n- implementation \"com.facebook.react:react-native:+\" // From node_modules\n+ // The version of react-native is set by the React Native Gradle Plugin\n+ implementation(\"com.facebook.react:react-android\")\n \n def isGifEnabled = (findProperty('expo.gif.enabled') ?: \"\") == \"true\";\n def isWebpEnabled = (findProperty('expo.webp.enabled') ?: \"\") == \"true\";\n@@ -298,70 +200,38 @@ dependencies {\n \n // If your app supports Android versions before Ice Cream Sandwich (API level 14)\n if (isGifEnabled || isWebpEnabled) {\n- implementation \"com.facebook.fresco:fresco:${frescoVersion}\"\n- implementation \"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:fresco:${frescoVersion}\")\n+ implementation(\"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\")\n }\n \n if (isGifEnabled) {\n // For animated gif support\n- implementation \"com.facebook.fresco:animated-gif:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-gif:${frescoVersion}\")\n }\n \n if (isWebpEnabled) {\n // For webp support\n- implementation \"com.facebook.fresco:webpsupport:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:webpsupport:${frescoVersion}\")\n if (isWebpAnimatedEnabled) {\n // Animated webp support\n- implementation \"com.facebook.fresco:animated-webp:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-webp:${frescoVersion}\")\n }\n }\n \n- implementation \"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\"\n- debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.fbjni'\n- }\n+ implementation(\"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\")\n+\n+ debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\")\n debugImplementation(\"com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n exclude group:'com.squareup.okhttp3', module:'okhttp'\n }\n- debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n- }\n+ debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\")\n \n- if (enableHermes) {\n- debugImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-debug.aar\"))\n- releaseImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-release.aar\"))\n+ if (hermesEnabled.toBoolean()) {\n+ implementation(\"com.facebook.react:hermes-android\")\n } else {\n implementation jscFlavor\n }\n }\n \n-if (isNewArchitectureEnabled()) {\n- // If new architecture is enabled, we let you build RN from source\n- // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.\n- // This will be applied to all the imported transtitive dependency.\n- configurations.all {\n- resolutionStrategy.dependencySubstitution {\n- substitute(module(\"com.facebook.react:react-native\"))\n- .using(project(\":ReactAndroid\")).because(\"On New Architecture we're building React Native from source\")\n- }\n- }\n-}\n-\n-// Run this once to be able to run the application with BUCK\n-// puts all compile dependencies into folder libs for BUCK to use\n-task copyDownloadableDepsToLibs(type: Copy) {\n- from configurations.implementation\n- into 'libs'\n-}\n-\n apply from: new File([\"node\", \"--print\", \"require.resolve('@react-native-community/cli-platform-android/package.json')\"].execute(null, rootDir).text.trim(), \"../native_modules.gradle\");\n applyNativeModulesAppBuildGradle(project)\n-\n-def isNewArchitectureEnabled() {\n- // To opt-in for the New Architecture, you can either:\n- // - Set `newArchEnabled` to true inside the `gradle.properties` file\n- // - Invoke gradle with `-newArchEnabled=true`\n- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`\n- return project.hasProperty(\"newArchEnabled\") && project.newArchEnabled == \"true\"\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/build_defs.bzl b/templates/expo-template-bare-minimum/android/app/build_defs.bzl\ndeleted file mode 100644\nindex fff270f8d1..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/build_defs.bzl\n+++ /dev/null\n@@ -1,19 +0,0 @@\n-\"\"\"Helper definitions to glob .aar and .jar targets\"\"\"\n-\n-def create_aar_targets(aarfiles):\n- for aarfile in aarfiles:\n- name = \"aars__\" + aarfile[aarfile.rindex(\"/\") + 1:aarfile.rindex(\".aar\")]\n- lib_deps.append(\":\" + name)\n- android_prebuilt_aar(\n- name = name,\n- aar = aarfile,\n- )\n-\n-def create_jar_targets(jarfiles):\n- for jarfile in jarfiles:\n- name = \"jars__\" + jarfile[jarfile.rindex(\"/\") + 1:jarfile.rindex(\".jar\")]\n- lib_deps.append(\":\" + name)\n- prebuilt_jar(\n- name = name,\n- binary_jar = jarfile,\n- )\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\nindex 8cddb11cb2..595dd5831c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n@@ -1,5 +1,5 @@\n /**\n- * Copyright (c) Facebook, Inc. and its affiliates.\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *

This source code is licensed under the MIT license found in the LICENSE file in the root\n * directory of this source tree.\n@@ -17,22 +17,27 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping;\n import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;\n import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;\n import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;\n-import com.facebook.flipper.plugins.react.ReactFlipperPlugin;\n import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;\n+import com.facebook.react.ReactInstanceEventListener;\n import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.bridge.ReactContext;\n import com.facebook.react.modules.network.NetworkingModule;\n import okhttp3.OkHttpClient;\n \n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the debug\n+ * flavor of it. Here you can add your own plugins and customize the Flipper setup.\n+ */\n public class ReactNativeFlipper {\n public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n if (FlipperUtils.shouldEnableFlipper(context)) {\n final FlipperClient client = AndroidFlipperClient.getInstance(context);\n+\n client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));\n- client.addPlugin(new ReactFlipperPlugin());\n client.addPlugin(new DatabasesFlipperPlugin(context));\n client.addPlugin(new SharedPreferencesFlipperPlugin(context));\n client.addPlugin(CrashReporterPlugin.getInstance());\n+\n NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();\n NetworkingModule.setCustomClientBuilder(\n new NetworkingModule.CustomClientBuilder() {\n@@ -43,12 +48,13 @@ public class ReactNativeFlipper {\n });\n client.addPlugin(networkFlipperPlugin);\n client.start();\n+\n // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized\n // Hence we run if after all native modules have been initialized\n ReactContext reactContext = reactInstanceManager.getCurrentReactContext();\n if (reactContext == null) {\n reactInstanceManager.addReactInstanceEventListener(\n- new ReactInstanceManager.ReactInstanceEventListener() {\n+ new ReactInstanceEventListener() {\n @Override\n public void onReactContextInitialized(ReactContext reactContext) {\n reactInstanceManager.removeReactInstanceEventListener(this);\n@@ -66,4 +72,4 @@ public class ReactNativeFlipper {\n }\n }\n }\n-}\n\\ No newline at end of file\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\nindex 0cad655b33..6536fc03ad 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n@@ -1,4 +1,4 @@\n-\n+\n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 576e23db45..7e2823fb6c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -28,11 +29,21 @@ public class MainActivity extends ReactActivity {\n return \"main\";\n }\n \n+ /**\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n+ */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled\n+ // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).\n+ DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled\n+ ));\n }\n \n /**\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..31c2b288c1 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,70 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \"index\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +73,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex f555e36448..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,116 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- new EmptyReactNativeConfig(),\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex 0ae6366756..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,49 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\nnew file mode 100644\nindex 0000000000..b510364404\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\n@@ -0,0 +1,20 @@\n+/**\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n+ *\n+ *

This source code is licensed under the MIT license found in the LICENSE file in the root\n+ * directory of this source tree.\n+ */\n+package com.helloworld;\n+\n+import android.content.Context;\n+import com.facebook.react.ReactInstanceManager;\n+\n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the release\n+ * flavor of it so it's empty as we don't want to load Flipper.\n+ */\n+public class ReactNativeFlipper {\n+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n+ // Do nothing as we don't want to initialize Flipper on Release.\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/build.gradle b/templates/expo-template-bare-minimum/android/build.gradle\nindex fa77528908..e5fda82878 100644\n--- a/templates/expo-template-bare-minimum/android/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/build.gradle\n@@ -1,50 +1,31 @@\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n // Top-level build file where you can add configuration options common to all sub-projects/modules.\n \n buildscript {\n ext {\n- buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'\n+ buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0'\n minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')\n- compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')\n- targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')\n+ compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33')\n+ targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33')\n if (findProperty('android.kotlinVersion')) {\n kotlinVersion = findProperty('android.kotlinVersion')\n }\n frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'\n \n- if (System.properties['os.arch'] == 'aarch64') {\n- // For M1 Users we need to use the NDK 24 which added support for aarch64\n- ndkVersion = '24.0.8215888'\n- } else {\n- // Otherwise we default to the side-by-side NDK version from AGP.\n- ndkVersion = '21.4.7075529'\n- }\n+ // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.\n+ ndkVersion = \"23.1.7779620\"\n }\n repositories {\n google()\n mavenCentral()\n }\n dependencies {\n- classpath('com.android.tools.build:gradle:7.0.4')\n+ classpath('com.android.tools.build:gradle:7.4.1')\n classpath('com.facebook.react:react-native-gradle-plugin')\n- classpath('de.undercouch:gradle-download-task:4.1.2')\n- // NOTE: Do not place your application dependencies here; they belong\n- // in the individual module build.gradle files\n }\n }\n \n-def REACT_NATIVE_VERSION = new File(['node', '--print',\"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n-\n allprojects {\n- configurations.all {\n- resolutionStrategy {\n- force \"com.facebook.react:react-native:\" + REACT_NATIVE_VERSION\n- }\n- }\n-\n repositories {\n- mavenLocal()\n maven {\n // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm\n url(new File(['node', '--print', \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), '../android'))\n@@ -55,13 +36,7 @@ allprojects {\n }\n \n google()\n- mavenCentral {\n- // We don't want to fetch react-native from Maven Central as there are\n- // older versions over there.\n- content {\n- excludeGroup 'com.facebook.react'\n- }\n- }\n+ mavenCentral()\n maven { url 'https://www.jitpack.io' }\n }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/gitignore b/templates/expo-template-bare-minimum/android/gitignore\nindex 64436baaf5..877b87e9a5 100644\n--- a/templates/expo-template-bare-minimum/android/gitignore\n+++ b/templates/expo-template-bare-minimum/android/gitignore\n@@ -11,11 +11,5 @@ local.properties\n *.iml\n *.hprof\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/android/gradle.properties b/templates/expo-template-bare-minimum/android/gradle.properties\nindex fab3fb6bcf..9911ac4afd 100644\n--- a/templates/expo-template-bare-minimum/android/gradle.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle.properties\n@@ -42,7 +42,7 @@ newArchEnabled=false\n \n # The hosted JavaScript engine\n # Supported values: expo.jsEngine = \"hermes\" | \"jsc\"\n-expo.jsEngine=jsc\n+expo.jsEngine=hermes\n \n # Enable GIF support in React Native images (~200 B increase)\n expo.gif.enabled=true\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar\nindex 7454180f2a..249e5832f0 100644\nBinary files a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar and b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar differ\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\nindex 669386b870..8fad3f5a98 100644\n--- a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n@@ -1,5 +1,5 @@\n distributionBase=GRADLE_USER_HOME\n distributionPath=wrapper/dists\n-distributionUrl=https\\://services.gradle.org/distributions/gradle-7.3.3-all.zip\n+distributionUrl=https\\://services.gradle.org/distributions/gradle-7.5.1-all.zip\n zipStoreBase=GRADLE_USER_HOME\n zipStorePath=wrapper/dists\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew b/templates/expo-template-bare-minimum/android/gradlew\nindex 1b6c787337..a69d9cb6c2 100755\n--- a/templates/expo-template-bare-minimum/android/gradlew\n+++ b/templates/expo-template-bare-minimum/android/gradlew\n@@ -205,6 +205,12 @@ set -- \\\n org.gradle.wrapper.GradleWrapperMain \\\n \"$@\"\n \n+# Stop when \"xargs\" is not available.\n+if ! command -v xargs >/dev/null 2>&1\n+then\n+ die \"xargs is not available\"\n+fi\n+\n # Use \"xargs\" to parse quoted args.\n #\n # With -n1 it outputs one arg per line, with the quotes and backslashes removed.\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew.bat b/templates/expo-template-bare-minimum/android/gradlew.bat\nindex ac1b06f938..53a6b238d4 100644\n--- a/templates/expo-template-bare-minimum/android/gradlew.bat\n+++ b/templates/expo-template-bare-minimum/android/gradlew.bat\n@@ -14,7 +14,7 @@\n @rem limitations under the License.\r\n @rem\r\n \r\n-@if \"%DEBUG%\" == \"\" @echo off\r\n+@if \"%DEBUG%\"==\"\" @echo off\r\n @rem ##########################################################################\r\n @rem\r\n @rem Gradle startup script for Windows\r\n@@ -25,7 +25,7 @@\n if \"%OS%\"==\"Windows_NT\" setlocal\r\n \r\n set DIRNAME=%~dp0\r\n-if \"%DIRNAME%\" == \"\" set DIRNAME=.\r\n+if \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n set APP_BASE_NAME=%~n0\r\n set APP_HOME=%DIRNAME%\r\n \r\n@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome\n \r\n set JAVA_EXE=java.exe\r\n %JAVA_EXE% -version >NUL 2>&1\r\n-if \"%ERRORLEVEL%\" == \"0\" goto execute\r\n+if %ERRORLEVEL% equ 0 goto execute\r\n \r\n echo.\r\n echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\n@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n \r\n :end\r\n @rem End local scope for the variables with windows NT shell\r\n-if \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n+if %ERRORLEVEL% equ 0 goto mainEnd\r\n \r\n :fail\r\n rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\n rem the _cmd.exe /c_ return code!\r\n-if not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\n-exit /b 1\r\n+set EXIT_CODE=%ERRORLEVEL%\r\n+if %EXIT_CODE% equ 0 set EXIT_CODE=1\r\n+if not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\n+exit /b %EXIT_CODE%\r\n \r\n :mainEnd\r\n if \"%OS%\"==\"Windows_NT\" endlocal\r\ndiff --git a/templates/expo-template-bare-minimum/android/settings.gradle b/templates/expo-template-bare-minimum/android/settings.gradle\nindex fa543f0c69..1dc416e7c1 100644\n--- a/templates/expo-template-bare-minimum/android/settings.gradle\n+++ b/templates/expo-template-bare-minimum/android/settings.gradle\n@@ -8,8 +8,3 @@ applyNativeModulesSettingsGradle(settings)\n \n include ':app'\n includeBuild(new File([\"node\", \"--print\", \"require.resolve('react-native-gradle-plugin/package.json')\"].execute(null, rootDir).text.trim()).getParentFile())\n-\n-if (settings.hasProperty(\"newArchEnabled\") && settings.newArchEnabled == \"true\") {\n- include(\":ReactAndroid\")\n- project(\":ReactAndroid\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid\");\n-}\ndiff --git a/templates/expo-template-bare-minimum/gitignore b/templates/expo-template-bare-minimum/gitignore\nindex c8eb0f9a64..df57ba88a1 100644\n--- a/templates/expo-template-bare-minimum/gitignore\n+++ b/templates/expo-template-bare-minimum/gitignore\n@@ -30,6 +30,9 @@ build/\n local.properties\n *.iml\n *.hprof\n+.cxx/\n+*.keystore\n+!debug.keystore\n \n # node.js\n #\n@@ -37,18 +40,15 @@ node_modules/\n npm-debug.log\n yarn-error.log\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\n \n # CocoaPods\n /ios/Pods/\n \n+# Temporary files created by Metro to check the health of the file watcher\n+.metro-health-check*\n+\n # Expo\n .expo/\n web-build/\ndiff --git a/templates/expo-template-bare-minimum/ios/.xcode.env b/templates/expo-template-bare-minimum/ios/.xcode.env\nnew file mode 100644\nindex 0000000000..3d5782c715\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/ios/.xcode.env\n@@ -0,0 +1,11 @@\n+# This `.xcode.env` file is versioned and is used to source the environment\n+# used when running script phases inside Xcode.\n+# To customize your local environment, you can create an `.xcode.env.local`\n+# file that is not versioned.\n+\n+# NODE_BINARY variable contains the PATH to the node executable.\n+#\n+# Customize the NODE_BINARY variable here.\n+# For example, to use nvm with brew, add the following line\n+# . \"$(brew --prefix nvm)/nvm.sh\" --no-use\n+export NODE_BINARY=$(command -v node)\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\nindex 2ac180e425..98e6c2afea 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n@@ -214,7 +214,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"export NODE_BINARY=node\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\n`node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\nif [[ -z \\\"$ENTRY_FILE\\\" ]]; then\\n # Set the entry JS file using the bundler's entry resolution.\\n export ENTRY_FILE=\\\"$(\\\"$NODE_BINARY\\\" -e \\\"require('expo/scripts/resolveAppEntry')\\\" $PROJECT_ROOT ios relative | tail -n 1)\\\"\\nfi\\n\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n \t\t};\n \t\t08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {\n \t\t\tisa = PBXShellScriptBuildPhase;\n@@ -276,7 +276,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"export RCT_METRO_PORT=\\\"${RCT_METRO_PORT:=8081}\\\"\\necho \\\"export RCT_METRO_PORT=${RCT_METRO_PORT}\\\" > `node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\\\"`\\nif [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\\n if ! curl -s \\\"http://localhost:${RCT_METRO_PORT}/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n echo \\\"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\\\"\\n exit 2\\n fi\\n else\\n open `node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\\\"` || echo \\\"Can't start packager automatically\\\"\\n fi\\nfi\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\nexport RCT_METRO_PORT=\\\"${RCT_METRO_PORT:=8081}\\\"\\necho \\\"export RCT_METRO_PORT=${RCT_METRO_PORT}\\\" > `$NODE_BINARY --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\\\"`\\nif [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\\n if ! curl -s \\\"http://localhost:${RCT_METRO_PORT}/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n echo \\\"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\\\"\\n exit 2\\n fi\\n else\\n open `$NODE_BINARY --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\\\"` || echo \\\"Can't start packager automatically\\\"\\n fi\\nfi\\n\";\n \t\t\tshowEnvVarsInLog = 0;\n \t\t};\n /* End PBXShellScriptBuildPhase section */\n@@ -308,8 +308,9 @@\n \t\t\t\t\t\"FB_SONARKIT_ENABLED=1\",\n \t\t\t\t);\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -331,8 +332,9 @@\n \t\t\t\tCLANG_ENABLE_MODULES = YES;\n \t\t\t\tCURRENT_PROJECT_VERSION = 1;\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -392,7 +394,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n@@ -441,7 +443,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\nindex f7d2972042..1658a437eb 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n@@ -1,9 +1,7 @@\n-#import \n-#import \n+#import \n #import \n-\n #import \n \n-@interface AppDelegate : EXAppDelegateWrapper \n+@interface AppDelegate : EXAppDelegateWrapper\n \n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\nindex aef81ec589..8cb5aef137 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n@@ -1,66 +1,19 @@\n #import \"AppDelegate.h\"\n \n-#import \n #import \n-#import \n #import \n-#import \n-\n-#import \n-\n-#if RCT_NEW_ARCH_ENABLED\n-#import \n-#import \n-#import \n-#import \n-#import \n-#import \n-\n-#import \n-\n-@interface AppDelegate () {\n- RCTTurboModuleManager *_turboModuleManager;\n- RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;\n- std::shared_ptr _reactNativeConfig;\n- facebook::react::ContextContainer::Shared _contextContainer;\n-}\n-@end\n-#endif\n \n @implementation AppDelegate\n \n - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n {\n- RCTAppSetupPrepareApp(application);\n-\n- RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];\n-\n-#if RCT_NEW_ARCH_ENABLED\n- _contextContainer = std::make_shared();\n- _reactNativeConfig = std::make_shared();\n- _contextContainer->insert(\"ReactNativeConfig\", _reactNativeConfig);\n- _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];\n- bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;\n-#endif\n+ self.moduleName = @\"main\";\n \n- UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:nil];\n+ // You can add your custom initial props in the dictionary below.\n+ // They will be passed down to the ViewController used by React Native.\n+ self.initialProps = @{};\n \n- rootView.backgroundColor = [UIColor whiteColor];\n- self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n- UIViewController *rootViewController = [self.reactDelegate createRootViewController];\n- rootViewController.view = rootView;\n- self.window.rootViewController = rootViewController;\n- [self.window makeKeyAndVisible];\n-\n- [super application:application didFinishLaunchingWithOptions:launchOptions];\n-\n- return YES;\n-}\n-\n-- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge\n-{\n- // If you'd like to export some custom RCTBridgeModules, add them here!\n- return @[];\n+ return [super application:application didFinishLaunchingWithOptions:launchOptions];\n }\n \n - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n@@ -72,6 +25,16 @@\n #endif\n }\n \n+/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.\n+///\n+/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html\n+/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).\n+/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.\n+- (BOOL)concurrentRootEnabled\n+{\n+ return true;\n+}\n+\n // Linking API\n - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options {\n return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];\n@@ -101,43 +64,4 @@\n return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];\n }\n \n-#if RCT_NEW_ARCH_ENABLED\n-\n-#pragma mark - RCTCxxBridgeDelegate\n-\n-- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge\n-{\n- _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge\n- delegate:self\n- jsInvoker:bridge.jsCallInvoker];\n- return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);\n-}\n-\n-#pragma mark RCTTurboModuleManagerDelegate\n-\n-- (Class)getModuleClassFromName:(const char *)name\n-{\n- return RCTCoreModulesClassProvider(name);\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- jsInvoker:(std::shared_ptr)jsInvoker\n-{\n- return nullptr;\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- initParams:\n- (const facebook::react::ObjCTurboModule::InitParams &)params\n-{\n- return nullptr;\n-}\n-\n-- (id)getModuleInstanceFromClass:(Class)moduleClass\n-{\n- return RCTAppSetupDefaultModuleFromClass(moduleClass);\n-}\n-\n-#endif\n-\n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile b/templates/expo-template-bare-minimum/ios/Podfile\nindex 29797efaaa..e523ea5cac 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile\n+++ b/templates/expo-template-bare-minimum/ios/Podfile\n@@ -5,37 +5,79 @@ require File.join(File.dirname(`node --print \"require.resolve('@react-native-com\n require 'json'\n podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}\n \n-platform :ios, podfile_properties['ios.deploymentTarget'] || '12.0'\n+ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'\n+ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = '1' if podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == 'true'\n+\n+platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'\n install! 'cocoapods',\n :deterministic_uuids => false\n \n+prepare_react_native_project!\n+\n+# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.\n+# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,\n+# you can also exclude `react-native-flipper` in `react-native.config.js`\n+#\n+# ```js\n+# module.exports = {\n+# dependencies: {\n+# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),\n+# }\n+# }\n+# ```\n+flipper_config = FlipperConfiguration.disabled\n+if ENV['NO_FLIPPER'] == '1' then\n+ # Explicitly disabled through environment variables\n+ flipper_config = FlipperConfiguration.disabled\n+elsif podfile_properties.key?('ios.flipper') then\n+ # Configure Flipper in Podfile.properties.json\n+ if podfile_properties['ios.flipper'] == 'true' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"])\n+ elsif podfile_properties['ios.flipper'] != 'false' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"], { 'Flipper' => podfile_properties['ios.flipper'] })\n+ end\n+end\n+\n target 'HelloWorld' do\n use_expo_modules!\n config = use_native_modules!\n \n use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']\n+ use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']\n \n # Flags change depending on the env values.\n flags = get_default_flags()\n \n use_react_native!(\n :path => config[:reactNativePath],\n- :hermes_enabled => flags[:hermes_enabled] || podfile_properties['expo.jsEngine'] == 'hermes',\n+ :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',\n :fabric_enabled => flags[:fabric_enabled],\n # An absolute path to your application root.\n- :app_path => \"#{Dir.pwd}/..\"\n+ :app_path => \"#{Pod::Config.instance.installation_root}/..\",\n+ # Note that if you have use_frameworks! enabled, Flipper will not work if enabled\n+ :flipper_configuration => flipper_config\n )\n \n- # Uncomment to opt-in to using Flipper\n- # Note that if you have use_frameworks! enabled, Flipper will not work\n- #\n- # if !ENV['CI']\n- # use_flipper!()\n- # end\n-\n post_install do |installer|\n- react_native_post_install(installer)\n+ react_native_post_install(\n+ installer,\n+ config[:reactNativePath],\n+ # Set `mac_catalyst_enabled` to `true` in order to apply patches\n+ # necessary for Mac Catalyst builds\n+ :mac_catalyst_enabled => false\n+ )\n __apply_Xcode_12_5_M1_post_install_workaround(installer)\n+\n+ # This is necessary for Xcode 14, because it signs resource bundles by default\n+ # when building for devices.\n+ installer.target_installation_results.pod_target_installation_results\n+ .each do |pod_name, target_installation_result|\n+ target_installation_result.resource_bundle_targets.each do |resource_bundle_target|\n+ resource_bundle_target.build_configurations.each do |config|\n+ config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n+ end\n+ end\n+ end\n end\n \n post_integrate do |installer|\n@@ -45,5 +87,4 @@ target 'HelloWorld' do\n Pod::UI.warn e\n end\n end\n-\n end\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile.properties.json b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\nindex f6d872e81a..b1bd45da51 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n+++ b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n@@ -1,3 +1,3 @@\n {\n- \"expo.jsEngine\": \"jsc\"\n+ \"expo.jsEngine\": \"hermes\"\n }\ndiff --git a/templates/expo-template-bare-minimum/ios/gitignore b/templates/expo-template-bare-minimum/ios/gitignore\nindex 2b13519939..8beb344303 100644\n--- a/templates/expo-template-bare-minimum/ios/gitignore\n+++ b/templates/expo-template-bare-minimum/ios/gitignore\n@@ -21,6 +21,7 @@ DerivedData\n *.ipa\n *.xcuserstate\n project.xcworkspace\n+.xcode.env.local\n \n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json\nindex 69e7eb9619..d1fcd513cc 100644\n--- a/templates/expo-template-bare-minimum/package.json\n+++ b/templates/expo-template-bare-minimum/package.json\n@@ -1,7 +1,7 @@\n {\n \"name\": \"expo-template-bare-minimum\",\n \"description\": \"This bare project template includes a minimal setup for using unimodules with React Native.\",\n- \"version\": \"45.0.6\",\n+ \"version\": \"48.0.21\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"expo start --dev-client\",\n@@ -10,15 +10,13 @@\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n- \"expo\": \"~45.0.0\",\n- \"expo-splash-screen\": \"~0.15.1\",\n- \"expo-status-bar\": \"~1.3.0\",\n- \"react\": \"17.0.2\",\n- \"react-dom\": \"17.0.2\",\n- \"react-native\": \"0.68.2\",\n- \"react-native-web\": \"0.17.7\"\n+ \"expo\": \"~48.0.21\",\n+ \"expo-splash-screen\": \"~0.18.2\",\n+ \"expo-status-bar\": \"~1.4.4\",\n+ \"react\": \"18.2.0\",\n+ \"react-native\": \"0.71.14\"\n },\n \"devDependencies\": {\n- \"@babel/core\": \"^7.12.9\"\n+ \"@babel/core\": \"^7.20.0\"\n }\n }\n","46..48":"diff --git a/templates/expo-template-bare-minimum/.buckconfig b/templates/expo-template-bare-minimum/.buckconfig\ndeleted file mode 100644\nindex 934256cb29..0000000000\n--- a/templates/expo-template-bare-minimum/.buckconfig\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-\n-[android]\n- target = Google Inc.:Google APIs:23\n-\n-[maven_repositories]\n- central = https://repo1.maven.org/maven2\ndiff --git a/templates/expo-template-bare-minimum/.npmignore b/templates/expo-template-bare-minimum/.npmignore\nindex 35490b6612..4e6ce00391 100644\n--- a/templates/expo-template-bare-minimum/.npmignore\n+++ b/templates/expo-template-bare-minimum/.npmignore\n@@ -20,3 +20,4 @@ ios/Pods\n android/.build\n android/app/build\n android/.gradle\n+ios/.xcode.env.local\ndiff --git a/templates/expo-template-bare-minimum/android/app/BUCK b/templates/expo-template-bare-minimum/android/app/BUCK\ndeleted file mode 100644\nindex 0e77904834..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/BUCK\n+++ /dev/null\n@@ -1,55 +0,0 @@\n-# To learn about Buck see [Docs](https://buckbuild.com/).\n-# To run your application with Buck:\n-# - install Buck\n-# - `npm start` - to start the packager\n-# - `cd android`\n-# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\"`\n-# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck\n-# - `buck install -r android/app` - compile, install and run application\n-#\n-\n-load(\":build_defs.bzl\", \"create_aar_targets\", \"create_jar_targets\")\n-\n-lib_deps = []\n-\n-create_aar_targets(glob([\"libs/*.aar\"]))\n-\n-create_jar_targets(glob([\"libs/*.jar\"]))\n-\n-android_library(\n- name = \"all-libs\",\n- exported_deps = lib_deps,\n-)\n-\n-android_library(\n- name = \"app-code\",\n- srcs = glob([\n- \"src/main/java/**/*.java\",\n- ]),\n- deps = [\n- \":all-libs\",\n- \":build_config\",\n- \":res\",\n- ],\n-)\n-\n-android_build_config(\n- name = \"build_config\",\n- package = \"com.helloworld\",\n-)\n-\n-android_resource(\n- name = \"res\",\n- package = \"com.helloworld\",\n- res = \"src/main/res\",\n-)\n-\n-android_binary(\n- name = \"app\",\n- keystore = \"//android/keystores:debug\",\n- manifest = \"src/main/AndroidManifest.xml\",\n- package_type = \"debug\",\n- deps = [\n- \":app-code\",\n- ],\n-)\ndiff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex f0293fe400..189390e7e3 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -1,136 +1,107 @@\n apply plugin: \"com.android.application\"\n+apply plugin: \"com.facebook.react\"\n \n import com.android.build.OutputFile\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n-/**\n- * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n- * and bundleReleaseJsAndAssets).\n- * These basically call `react-native bundle` with the correct arguments during the Android build\n- * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the\n- * bundle directly from the development server. Below you can see all the possible configurations\n- * and their defaults. If you decide to add a configuration block, make sure to add it before the\n- * `apply from: \"../../node_modules/react-native/react.gradle\"` line.\n- *\n- * project.ext.react = [\n- * // the name of the generated asset file containing your JS bundle\n- * bundleAssetName: \"index.android.bundle\",\n- *\n- * // the entry file for bundle generation. If none specified and\n- * // \"index.android.js\" exists, it will be used. Otherwise \"index.js\" is\n- * // default. Can be overridden with ENTRY_FILE environment variable.\n- * entryFile: \"index.android.js\",\n- *\n- * // https://reactnative.dev/docs/performance#enable-the-ram-format\n- * bundleCommand: \"ram-bundle\",\n- *\n- * // whether to bundle JS and assets in debug mode\n- * bundleInDebug: false,\n- *\n- * // whether to bundle JS and assets in release mode\n- * bundleInRelease: true,\n- *\n- * // whether to bundle JS and assets in another build variant (if configured).\n- * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants\n- * // The configuration property can be in the following formats\n- * // 'bundleIn${productFlavor}${buildType}'\n- * // 'bundleIn${buildType}'\n- * // bundleInFreeDebug: true,\n- * // bundleInPaidRelease: true,\n- * // bundleInBeta: true,\n- *\n- * // whether to disable dev mode in custom build variants (by default only disabled in release)\n- * // for example: to disable dev mode in the staging build type (if configured)\n- * devDisabledInStaging: true,\n- * // The configuration property can be in the following formats\n- * // 'devDisabledIn${productFlavor}${buildType}'\n- * // 'devDisabledIn${buildType}'\n- *\n- * // the root of your project, i.e. where \"package.json\" lives\n- * root: \"../../\",\n- *\n- * // where to put the JS bundle asset in debug mode\n- * jsBundleDirDebug: \"$buildDir/intermediates/assets/debug\",\n- *\n- * // where to put the JS bundle asset in release mode\n- * jsBundleDirRelease: \"$buildDir/intermediates/assets/release\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in debug mode\n- * resourcesDirDebug: \"$buildDir/intermediates/res/merged/debug\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in release mode\n- * resourcesDirRelease: \"$buildDir/intermediates/res/merged/release\",\n- *\n- * // by default the gradle tasks are skipped if none of the JS files or assets change; this means\n- * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to\n- * // date; if you have any other folders that you want to ignore for performance reasons (gradle\n- * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/\n- * // for example, you might want to remove it from here.\n- * inputExcludes: [\"android/**\", \"ios/**\"],\n- *\n- * // override which node gets called and with what additional arguments\n- * nodeExecutableAndArgs: [\"node\"],\n- *\n- * // supply additional arguments to the packager\n- * extraPackagerArgs: []\n- * ]\n- */\n \n def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()\n+def expoDebuggableVariants = ['debug']\n+// Override `debuggableVariants` for expo-updates debugging\n+if (System.getenv('EX_UPDATES_NATIVE_DEBUG') == \"1\") {\n+ react {\n+ expoDebuggableVariants = []\n+ }\n+}\n \n-def reactNativeRoot = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath()\n \n-project.ext.react = [\n- entryFile: [\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\"].execute(null, rootDir).text.trim(),\n- enableHermes: (findProperty('expo.jsEngine') ?: \"jsc\") == \"hermes\",\n- hermesCommand: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\",\n- cliPath: \"${reactNativeRoot}/cli.js\",\n- composeSourceMapsPath: \"${reactNativeRoot}/scripts/compose-source-maps.js\",\n-]\n+/**\n+ * This is the configuration block to customize your React Native Android app.\n+ * By default you don't need to apply any configuration, just uncomment the lines you need.\n+ */\n+react {\n+ entryFile = file([\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\", \"absolute\"].execute(null, rootDir).text.trim())\n+ reactNativeDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()\n+ hermesCommand = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\"\n+ debuggableVariants = expoDebuggableVariants\n+\n+ /* Folders */\n+ // The root of your project, i.e. where \"package.json\" lives. Default is '..'\n+ // root = file(\"../\")\n+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native\n+ // reactNativeDir = file(\"../node_modules/react-native\")\n+ // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen\n+ // codegenDir = file(\"../node_modules/react-native-codegen\")\n+ // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js\n+ // cliFile = file(\"../node_modules/react-native/cli.js\")\n+\n+ /* Variants */\n+ // The list of variants to that are debuggable. For those we're going to\n+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.\n+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.\n+ // debuggableVariants = [\"liteDebug\", \"prodDebug\"]\n+\n+ /* Bundling */\n+ // A list containing the node command and its flags. Default is just 'node'.\n+ // nodeExecutableAndArgs = [\"node\"]\n+ //\n+ // The command to run when bundling. By default is 'bundle'\n+ // bundleCommand = \"ram-bundle\"\n+ //\n+ // The path to the CLI configuration file. Default is empty.\n+ // bundleConfig = file(../rn-cli.config.js)\n+ //\n+ // The name of the generated asset file containing your JS bundle\n+ // bundleAssetName = \"MyApplication.android.bundle\"\n+ //\n+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'\n+ // entryFile = file(\"../js/MyApplication.android.js\")\n+ //\n+ // A list of extra flags to pass to the 'bundle' commands.\n+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle\n+ // extraPackagerArgs = []\n+\n+ /* Hermes Commands */\n+ // The hermes compiler command to run. By default it is 'hermesc'\n+ // hermesCommand = \"$rootDir/my-custom-hermesc/bin/hermesc\"\n+ //\n+ // The list of flags to pass to the Hermes compiler. By default is \"-O\", \"-output-source-map\"\n+ // hermesFlags = [\"-O\", \"-output-source-map\"]\n+}\n \n-apply from: new File(reactNativeRoot, \"react.gradle\")\n+// Override `hermesEnabled` by `expo.jsEngine`\n+ext {\n+ hermesEnabled = (findProperty('expo.jsEngine') ?: \"hermes\") == \"hermes\"\n+}\n \n /**\n- * Set this to true to create two separate APKs instead of one:\n- * - An APK that only works on ARM devices\n- * - An APK that only works on x86 devices\n- * The advantage is the size of the APK is reduced by about 4MB.\n- * Upload all the APKs to the Play Store and people will download\n- * the correct one based on the CPU architecture of their device.\n+ * Set this to true to create four separate APKs instead of one,\n+ * one for each native architecture. This is useful if you don't\n+ * use App Bundles (https://developer.android.com/guide/app-bundle/)\n+ * and want to have separate APKs to upload to the Play Store.\n */\n def enableSeparateBuildPerCPUArchitecture = false\n \n /**\n- * Run Proguard to shrink the Java bytecode in release builds.\n+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.\n */\n def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()\n \n /**\n- * The preferred build flavor of JavaScriptCore.\n+ * The preferred build flavor of JavaScriptCore (JSC)\n *\n * For example, to use the international variant, you can use:\n * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`\n *\n * The international variant includes ICU i18n library and necessary data\n * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that\n- * give correct results when using with locales other than en-US. Note that\n+ * give correct results when using with locales other than en-US. Note that\n * this variant is about 6MiB larger per architecture than default.\n */\n def jscFlavor = 'org.webkit:android-jsc:+'\n \n /**\n- * Whether to enable the Hermes VM.\n- *\n- * This should be set on project.ext.react and that value will be read here. If it is not set\n- * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode\n- * and the benefits of using Hermes will therefore be sharply reduced.\n- */\n-def enableHermes = project.ext.react.get(\"enableHermes\", false);\n-\n-/**\n- * Architectures to build native code for.\n+ * Private function to get the list of Native Architectures you want to build.\n+ * This reads the value from reactNativeArchitectures in your gradle.properties\n+ * file and works together with the --active-arch-only flag of react-native run-android.\n */\n def reactNativeArchitectures() {\n def value = project.getProperties().get(\"reactNativeArchitectures\")\n@@ -142,85 +113,13 @@ android {\n \n compileSdkVersion rootProject.ext.compileSdkVersion\n \n+ namespace \"com.helloworld\"\n defaultConfig {\n applicationId \"com.helloworld\"\n minSdkVersion rootProject.ext.minSdkVersion\n targetSdkVersion rootProject.ext.targetSdkVersion\n versionCode 1\n versionName \"1.0\"\n- buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- arguments \"APP_PLATFORM=android-21\",\n- \"APP_STL=c++_shared\",\n- \"NDK_TOOLCHAIN_VERSION=clang\",\n- \"GENERATED_SRC_DIR=$buildDir/generated/source\",\n- \"PROJECT_BUILD_DIR=$buildDir\",\n- \"REACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid\",\n- \"REACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build\",\n- \"NODE_MODULES_DIR=$rootDir/../node_modules\"\n- cFlags \"-Wall\", \"-Werror\", \"-fexceptions\", \"-frtti\", \"-DWITH_INSPECTOR=1\"\n- cppFlags \"-std=c++17\"\n- // Make sure this target name is the same you specify inside the\n- // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.\n- targets \"helloworld_appmodules\"\n-\n- // Fix for windows limit on number of character in file paths and in command lines\n- if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n- arguments \"NDK_APP_SHORT_COMMANDS=true\"\n- }\n- }\n- }\n- if (!enableSeparateBuildPerCPUArchitecture) {\n- ndk {\n- abiFilters (*reactNativeArchitectures())\n- }\n- }\n- }\n- }\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- path \"$projectDir/src/main/jni/Android.mk\"\n- }\n- }\n- def reactAndroidProjectDir = project(':ReactAndroid').projectDir\n- def packageReactNdkDebugLibs = tasks.register(\"packageReactNdkDebugLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkDebugLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- def packageReactNdkReleaseLibs = tasks.register(\"packageReactNdkReleaseLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkReleaseLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- afterEvaluate {\n- // If you wish to add a custom TurboModule or component locally,\n- // you should uncomment this line.\n- // preBuild.dependsOn(\"generateCodegenArtifactsFromSchema\")\n- preDebugBuild.dependsOn(packageReactNdkDebugLibs)\n- preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)\n-\n- // Due to a bug inside AGP, we have to explicitly set a dependency\n- // between configureNdkBuild* tasks and the preBuild tasks.\n- // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732\n- configureNdkBuildRelease.dependsOn(preReleaseBuild)\n- configureNdkBuildDebug.dependsOn(preDebugBuild)\n- reactNativeArchitectures().each { architecture ->\n- tasks.findByName(\"configureNdkBuildDebug[${architecture}]\")?.configure {\n- dependsOn(\"preDebugBuild\")\n- }\n- tasks.findByName(\"configureNdkBuildRelease[${architecture}]\")?.configure {\n- dependsOn(\"preReleaseBuild\")\n- }\n- }\n- }\n }\n \n splits {\n@@ -247,6 +146,7 @@ android {\n // Caution! In production, you need to generate your own keystore file.\n // see https://reactnative.dev/docs/signed-apk-android.\n signingConfig signingConfigs.debug\n+ shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)\n minifyEnabled enableProguardInReleaseBuilds\n proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n }\n@@ -257,11 +157,12 @@ android {\n variant.outputs.each { output ->\n // For each separate APK per architecture, set a unique version code as described here:\n // https://developer.android.com/studio/build/configure-apk-splits.html\n+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.\n def versionCodes = [\"armeabi-v7a\": 1, \"x86\": 2, \"arm64-v8a\": 3, \"x86_64\": 4]\n def abi = output.getFilter(OutputFile.ABI)\n if (abi != null) { // null for the universal-debug, universal-release variants\n output.versionCodeOverride =\n- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)\n }\n \n }\n@@ -289,10 +190,8 @@ android {\n }\n \n dependencies {\n- implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n-\n- //noinspection GradleDynamicVersion\n- implementation \"com.facebook.react:react-native:+\" // From node_modules\n+ // The version of react-native is set by the React Native Gradle Plugin\n+ implementation(\"com.facebook.react:react-android\")\n \n def isGifEnabled = (findProperty('expo.gif.enabled') ?: \"\") == \"true\";\n def isWebpEnabled = (findProperty('expo.webp.enabled') ?: \"\") == \"true\";\n@@ -301,76 +200,38 @@ dependencies {\n \n // If your app supports Android versions before Ice Cream Sandwich (API level 14)\n if (isGifEnabled || isWebpEnabled) {\n- implementation \"com.facebook.fresco:fresco:${frescoVersion}\"\n- implementation \"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:fresco:${frescoVersion}\")\n+ implementation(\"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\")\n }\n \n if (isGifEnabled) {\n // For animated gif support\n- implementation \"com.facebook.fresco:animated-gif:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-gif:${frescoVersion}\")\n }\n \n if (isWebpEnabled) {\n // For webp support\n- implementation \"com.facebook.fresco:webpsupport:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:webpsupport:${frescoVersion}\")\n if (isWebpAnimatedEnabled) {\n // Animated webp support\n- implementation \"com.facebook.fresco:animated-webp:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-webp:${frescoVersion}\")\n }\n }\n \n- implementation \"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\"\n- debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.fbjni'\n- }\n+ implementation(\"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\")\n+\n+ debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\")\n debugImplementation(\"com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n exclude group:'com.squareup.okhttp3', module:'okhttp'\n }\n- debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n- }\n+ debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\")\n \n- if (enableHermes) {\n- //noinspection GradleDynamicVersion\n- implementation(\"com.facebook.react:hermes-engine:+\") { // From node_modules\n- exclude group:'com.facebook.fbjni'\n- }\n+ if (hermesEnabled.toBoolean()) {\n+ implementation(\"com.facebook.react:hermes-android\")\n } else {\n implementation jscFlavor\n }\n }\n \n-if (isNewArchitectureEnabled()) {\n- // If new architecture is enabled, we let you build RN from source\n- // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.\n- // This will be applied to all the imported transtitive dependency.\n- configurations.all {\n- resolutionStrategy.dependencySubstitution {\n- substitute(module(\"com.facebook.react:react-native\"))\n- .using(project(\":ReactAndroid\"))\n- .because(\"On New Architecture we're building React Native from source\")\n- substitute(module(\"com.facebook.react:hermes-engine\"))\n- .using(project(\":ReactAndroid:hermes-engine\"))\n- .because(\"On New Architecture we're building Hermes from source\")\n- }\n- }\n-}\n-\n-// Run this once to be able to run the application with BUCK\n-// puts all compile dependencies into folder libs for BUCK to use\n-task copyDownloadableDepsToLibs(type: Copy) {\n- from configurations.implementation\n- into 'libs'\n-}\n-\n apply from: new File([\"node\", \"--print\", \"require.resolve('@react-native-community/cli-platform-android/package.json')\"].execute(null, rootDir).text.trim(), \"../native_modules.gradle\");\n applyNativeModulesAppBuildGradle(project)\n-\n-def isNewArchitectureEnabled() {\n- // To opt-in for the New Architecture, you can either:\n- // - Set `newArchEnabled` to true inside the `gradle.properties` file\n- // - Invoke gradle with `-newArchEnabled=true`\n- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`\n- return project.hasProperty(\"newArchEnabled\") && project.newArchEnabled == \"true\"\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/build_defs.bzl b/templates/expo-template-bare-minimum/android/app/build_defs.bzl\ndeleted file mode 100644\nindex fff270f8d1..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/build_defs.bzl\n+++ /dev/null\n@@ -1,19 +0,0 @@\n-\"\"\"Helper definitions to glob .aar and .jar targets\"\"\"\n-\n-def create_aar_targets(aarfiles):\n- for aarfile in aarfiles:\n- name = \"aars__\" + aarfile[aarfile.rindex(\"/\") + 1:aarfile.rindex(\".aar\")]\n- lib_deps.append(\":\" + name)\n- android_prebuilt_aar(\n- name = name,\n- aar = aarfile,\n- )\n-\n-def create_jar_targets(jarfiles):\n- for jarfile in jarfiles:\n- name = \"jars__\" + jarfile[jarfile.rindex(\"/\") + 1:jarfile.rindex(\".jar\")]\n- lib_deps.append(\":\" + name)\n- prebuilt_jar(\n- name = name,\n- binary_jar = jarfile,\n- )\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\nindex 8cddb11cb2..595dd5831c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n@@ -1,5 +1,5 @@\n /**\n- * Copyright (c) Facebook, Inc. and its affiliates.\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *

This source code is licensed under the MIT license found in the LICENSE file in the root\n * directory of this source tree.\n@@ -17,22 +17,27 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping;\n import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;\n import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;\n import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;\n-import com.facebook.flipper.plugins.react.ReactFlipperPlugin;\n import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;\n+import com.facebook.react.ReactInstanceEventListener;\n import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.bridge.ReactContext;\n import com.facebook.react.modules.network.NetworkingModule;\n import okhttp3.OkHttpClient;\n \n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the debug\n+ * flavor of it. Here you can add your own plugins and customize the Flipper setup.\n+ */\n public class ReactNativeFlipper {\n public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n if (FlipperUtils.shouldEnableFlipper(context)) {\n final FlipperClient client = AndroidFlipperClient.getInstance(context);\n+\n client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));\n- client.addPlugin(new ReactFlipperPlugin());\n client.addPlugin(new DatabasesFlipperPlugin(context));\n client.addPlugin(new SharedPreferencesFlipperPlugin(context));\n client.addPlugin(CrashReporterPlugin.getInstance());\n+\n NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();\n NetworkingModule.setCustomClientBuilder(\n new NetworkingModule.CustomClientBuilder() {\n@@ -43,12 +48,13 @@ public class ReactNativeFlipper {\n });\n client.addPlugin(networkFlipperPlugin);\n client.start();\n+\n // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized\n // Hence we run if after all native modules have been initialized\n ReactContext reactContext = reactInstanceManager.getCurrentReactContext();\n if (reactContext == null) {\n reactInstanceManager.addReactInstanceEventListener(\n- new ReactInstanceManager.ReactInstanceEventListener() {\n+ new ReactInstanceEventListener() {\n @Override\n public void onReactContextInitialized(ReactContext reactContext) {\n reactInstanceManager.removeReactInstanceEventListener(this);\n@@ -66,4 +72,4 @@ public class ReactNativeFlipper {\n }\n }\n }\n-}\n\\ No newline at end of file\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\nindex 0cad655b33..6536fc03ad 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n@@ -1,4 +1,4 @@\n-\n+\n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 8e13797d9b..7e2823fb6c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -29,15 +30,20 @@ public class MainActivity extends ReactActivity {\n }\n \n /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled\n+ // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).\n+ DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled\n+ ));\n }\n \n /**\n@@ -59,25 +65,4 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..31c2b288c1 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,70 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \"index\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +73,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex cda1391225..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source\n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_runtime \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\nnew file mode 100644\nindex 0000000000..b510364404\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\n@@ -0,0 +1,20 @@\n+/**\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n+ *\n+ *

This source code is licensed under the MIT license found in the LICENSE file in the root\n+ * directory of this source tree.\n+ */\n+package com.helloworld;\n+\n+import android.content.Context;\n+import com.facebook.react.ReactInstanceManager;\n+\n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the release\n+ * flavor of it so it's empty as we don't want to load Flipper.\n+ */\n+public class ReactNativeFlipper {\n+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n+ // Do nothing as we don't want to initialize Flipper on Release.\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/build.gradle b/templates/expo-template-bare-minimum/android/build.gradle\nindex f259b31a11..e5fda82878 100644\n--- a/templates/expo-template-bare-minimum/android/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/build.gradle\n@@ -1,49 +1,31 @@\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n // Top-level build file where you can add configuration options common to all sub-projects/modules.\n+\n buildscript {\n ext {\n- buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'\n+ buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0'\n minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')\n- compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')\n- targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')\n+ compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33')\n+ targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33')\n if (findProperty('android.kotlinVersion')) {\n kotlinVersion = findProperty('android.kotlinVersion')\n }\n frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'\n \n- if (System.properties['os.arch'] == 'aarch64') {\n- // For M1 Users we need to use the NDK 24 which added support for aarch64\n- ndkVersion = '24.0.8215888'\n- } else {\n- // Otherwise we default to the side-by-side NDK version from AGP.\n- ndkVersion = '21.4.7075529'\n- }\n+ // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.\n+ ndkVersion = \"23.1.7779620\"\n }\n repositories {\n google()\n mavenCentral()\n }\n dependencies {\n- classpath('com.android.tools.build:gradle:7.1.1')\n+ classpath('com.android.tools.build:gradle:7.4.1')\n classpath('com.facebook.react:react-native-gradle-plugin')\n- classpath('de.undercouch:gradle-download-task:5.0.1')\n- // NOTE: Do not place your application dependencies here; they belong\n- // in the individual module build.gradle files\n }\n }\n \n-def REACT_NATIVE_VERSION = new File(['node', '--print',\"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n-\n allprojects {\n- configurations.all {\n- resolutionStrategy {\n- force \"com.facebook.react:react-native:\" + REACT_NATIVE_VERSION\n- }\n- }\n-\n repositories {\n- mavenLocal()\n maven {\n // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm\n url(new File(['node', '--print', \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), '../android'))\n@@ -54,19 +36,7 @@ allprojects {\n }\n \n google()\n- mavenCentral {\n- // We don't want to fetch react-native from Maven Central as there are\n- // older versions over there.\n- content {\n- excludeGroup 'com.facebook.react'\n- }\n- }\n+ mavenCentral()\n maven { url 'https://www.jitpack.io' }\n }\n }\n-\n-configurations.all {\n- resolutionStrategy {\n- force 'com.facebook.react:react-native:0.69.6'\n- }\n-}\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/gitignore b/templates/expo-template-bare-minimum/android/gitignore\nindex 64436baaf5..877b87e9a5 100644\n--- a/templates/expo-template-bare-minimum/android/gitignore\n+++ b/templates/expo-template-bare-minimum/android/gitignore\n@@ -11,11 +11,5 @@ local.properties\n *.iml\n *.hprof\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/android/gradle.properties b/templates/expo-template-bare-minimum/android/gradle.properties\nindex fab3fb6bcf..9911ac4afd 100644\n--- a/templates/expo-template-bare-minimum/android/gradle.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle.properties\n@@ -42,7 +42,7 @@ newArchEnabled=false\n \n # The hosted JavaScript engine\n # Supported values: expo.jsEngine = \"hermes\" | \"jsc\"\n-expo.jsEngine=jsc\n+expo.jsEngine=hermes\n \n # Enable GIF support in React Native images (~200 B increase)\n expo.gif.enabled=true\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar\nindex 7454180f2a..249e5832f0 100644\nBinary files a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar and b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar differ\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\nindex 669386b870..8fad3f5a98 100644\n--- a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n@@ -1,5 +1,5 @@\n distributionBase=GRADLE_USER_HOME\n distributionPath=wrapper/dists\n-distributionUrl=https\\://services.gradle.org/distributions/gradle-7.3.3-all.zip\n+distributionUrl=https\\://services.gradle.org/distributions/gradle-7.5.1-all.zip\n zipStoreBase=GRADLE_USER_HOME\n zipStorePath=wrapper/dists\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew b/templates/expo-template-bare-minimum/android/gradlew\nindex 1b6c787337..a69d9cb6c2 100755\n--- a/templates/expo-template-bare-minimum/android/gradlew\n+++ b/templates/expo-template-bare-minimum/android/gradlew\n@@ -205,6 +205,12 @@ set -- \\\n org.gradle.wrapper.GradleWrapperMain \\\n \"$@\"\n \n+# Stop when \"xargs\" is not available.\n+if ! command -v xargs >/dev/null 2>&1\n+then\n+ die \"xargs is not available\"\n+fi\n+\n # Use \"xargs\" to parse quoted args.\n #\n # With -n1 it outputs one arg per line, with the quotes and backslashes removed.\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew.bat b/templates/expo-template-bare-minimum/android/gradlew.bat\nindex ac1b06f938..53a6b238d4 100644\n--- a/templates/expo-template-bare-minimum/android/gradlew.bat\n+++ b/templates/expo-template-bare-minimum/android/gradlew.bat\n@@ -14,7 +14,7 @@\n @rem limitations under the License.\r\n @rem\r\n \r\n-@if \"%DEBUG%\" == \"\" @echo off\r\n+@if \"%DEBUG%\"==\"\" @echo off\r\n @rem ##########################################################################\r\n @rem\r\n @rem Gradle startup script for Windows\r\n@@ -25,7 +25,7 @@\n if \"%OS%\"==\"Windows_NT\" setlocal\r\n \r\n set DIRNAME=%~dp0\r\n-if \"%DIRNAME%\" == \"\" set DIRNAME=.\r\n+if \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n set APP_BASE_NAME=%~n0\r\n set APP_HOME=%DIRNAME%\r\n \r\n@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome\n \r\n set JAVA_EXE=java.exe\r\n %JAVA_EXE% -version >NUL 2>&1\r\n-if \"%ERRORLEVEL%\" == \"0\" goto execute\r\n+if %ERRORLEVEL% equ 0 goto execute\r\n \r\n echo.\r\n echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\n@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n \r\n :end\r\n @rem End local scope for the variables with windows NT shell\r\n-if \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n+if %ERRORLEVEL% equ 0 goto mainEnd\r\n \r\n :fail\r\n rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\n rem the _cmd.exe /c_ return code!\r\n-if not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\n-exit /b 1\r\n+set EXIT_CODE=%ERRORLEVEL%\r\n+if %EXIT_CODE% equ 0 set EXIT_CODE=1\r\n+if not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\n+exit /b %EXIT_CODE%\r\n \r\n :mainEnd\r\n if \"%OS%\"==\"Windows_NT\" endlocal\r\ndiff --git a/templates/expo-template-bare-minimum/android/settings.gradle b/templates/expo-template-bare-minimum/android/settings.gradle\nindex b3332319f9..1dc416e7c1 100644\n--- a/templates/expo-template-bare-minimum/android/settings.gradle\n+++ b/templates/expo-template-bare-minimum/android/settings.gradle\n@@ -8,10 +8,3 @@ applyNativeModulesSettingsGradle(settings)\n \n include ':app'\n includeBuild(new File([\"node\", \"--print\", \"require.resolve('react-native-gradle-plugin/package.json')\"].execute(null, rootDir).text.trim()).getParentFile())\n-\n-if (settings.hasProperty(\"newArchEnabled\") && settings.newArchEnabled == \"true\") {\n- include(\":ReactAndroid\")\n- project(\":ReactAndroid\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid\");\n- include(\":ReactAndroid:hermes-engine\")\n- project(\":ReactAndroid:hermes-engine\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid/hermes-engine\");\n-}\ndiff --git a/templates/expo-template-bare-minimum/gitignore b/templates/expo-template-bare-minimum/gitignore\nindex c8eb0f9a64..df57ba88a1 100644\n--- a/templates/expo-template-bare-minimum/gitignore\n+++ b/templates/expo-template-bare-minimum/gitignore\n@@ -30,6 +30,9 @@ build/\n local.properties\n *.iml\n *.hprof\n+.cxx/\n+*.keystore\n+!debug.keystore\n \n # node.js\n #\n@@ -37,18 +40,15 @@ node_modules/\n npm-debug.log\n yarn-error.log\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\n \n # CocoaPods\n /ios/Pods/\n \n+# Temporary files created by Metro to check the health of the file watcher\n+.metro-health-check*\n+\n # Expo\n .expo/\n web-build/\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\nindex a4a049f05d..98e6c2afea 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n@@ -214,7 +214,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\nif [[ -z \\\"$ENTRY_FILE\\\" ]]; then\\n # Set the entry JS file using the bundler's entry resolution.\\n export ENTRY_FILE=\\\"$(\\\"$NODE_BINARY\\\" -e \\\"require('expo/scripts/resolveAppEntry')\\\" $PROJECT_ROOT ios relative | tail -n 1)\\\"\\nfi\\n\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n \t\t};\n \t\t08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {\n \t\t\tisa = PBXShellScriptBuildPhase;\n@@ -308,8 +308,9 @@\n \t\t\t\t\t\"FB_SONARKIT_ENABLED=1\",\n \t\t\t\t);\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -331,8 +332,9 @@\n \t\t\t\tCLANG_ENABLE_MODULES = YES;\n \t\t\t\tCURRENT_PROJECT_VERSION = 1;\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -392,7 +394,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n@@ -441,7 +443,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\nindex f7d2972042..1658a437eb 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n@@ -1,9 +1,7 @@\n-#import \n-#import \n+#import \n #import \n-\n #import \n \n-@interface AppDelegate : EXAppDelegateWrapper \n+@interface AppDelegate : EXAppDelegateWrapper\n \n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\nindex a6e13e11ab..8cb5aef137 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n@@ -1,100 +1,40 @@\n #import \"AppDelegate.h\"\n \n-#import \n #import \n-#import \n #import \n-#import \n-\n-#import \n-\n-#if RCT_NEW_ARCH_ENABLED\n-#import \n-#import \n-#import \n-#import \n-#import \n-#import \n-\n-#import \n-\n-static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n-\n-@interface AppDelegate () {\n- RCTTurboModuleManager *_turboModuleManager;\n- RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;\n- std::shared_ptr _reactNativeConfig;\n- facebook::react::ContextContainer::Shared _contextContainer;\n-}\n-@end\n-#endif\n \n @implementation AppDelegate\n \n - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n {\n- RCTAppSetupPrepareApp(application);\n-\n- RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];\n-\n-#if RCT_NEW_ARCH_ENABLED\n- _contextContainer = std::make_shared();\n- _reactNativeConfig = std::make_shared();\n- _contextContainer->insert(\"ReactNativeConfig\", _reactNativeConfig);\n- _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];\n- bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;\n-#endif\n-\n- NSDictionary *initProps = [self prepareInitialProps];\n- UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:initProps];\n-\n- rootView.backgroundColor = [UIColor whiteColor];\n- self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n- UIViewController *rootViewController = [self.reactDelegate createRootViewController];\n- rootViewController.view = rootView;\n- self.window.rootViewController = rootViewController;\n- [self.window makeKeyAndVisible];\n+ self.moduleName = @\"main\";\n \n- [super application:application didFinishLaunchingWithOptions:launchOptions];\n+ // You can add your custom initial props in the dictionary below.\n+ // They will be passed down to the ViewController used by React Native.\n+ self.initialProps = @{};\n \n- return YES;\n+ return [super application:application didFinishLaunchingWithOptions:launchOptions];\n }\n \n-- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge\n+- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n {\n- // If you'd like to export some custom RCTBridgeModules, add them here!\n- return @[];\n+#if DEBUG\n+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n+#else\n+ return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n+#endif\n }\n \n /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.\n ///\n /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html\n /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).\n-/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.\n+/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.\n - (BOOL)concurrentRootEnabled\n {\n- // Switch this bool to turn on and off the concurrent root\n return true;\n }\n \n-- (NSDictionary *)prepareInitialProps\n-{\n- NSMutableDictionary *initProps = [NSMutableDictionary new];\n-#if RCT_NEW_ARCH_ENABLED\n- initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);\n-#endif\n- return initProps;\n-}\n-\n-- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n-{\n-#if DEBUG\n- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n-#else\n- return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n-#endif\n-}\n-\n // Linking API\n - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options {\n return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];\n@@ -124,43 +64,4 @@ static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];\n }\n \n-#if RCT_NEW_ARCH_ENABLED\n-\n-#pragma mark - RCTCxxBridgeDelegate\n-\n-- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge\n-{\n- _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge\n- delegate:self\n- jsInvoker:bridge.jsCallInvoker];\n- return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);\n-}\n-\n-#pragma mark RCTTurboModuleManagerDelegate\n-\n-- (Class)getModuleClassFromName:(const char *)name\n-{\n- return RCTCoreModulesClassProvider(name);\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- jsInvoker:(std::shared_ptr)jsInvoker\n-{\n- return nullptr;\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- initParams:\n- (const facebook::react::ObjCTurboModule::InitParams &)params\n-{\n- return nullptr;\n-}\n-\n-- (id)getModuleInstanceFromClass:(Class)moduleClass\n-{\n- return RCTAppSetupDefaultModuleFromClass(moduleClass);\n-}\n-\n-#endif\n-\n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile b/templates/expo-template-bare-minimum/ios/Podfile\nindex 91612acca9..e523ea5cac 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile\n+++ b/templates/expo-template-bare-minimum/ios/Podfile\n@@ -5,36 +5,67 @@ require File.join(File.dirname(`node --print \"require.resolve('@react-native-com\n require 'json'\n podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}\n \n-platform :ios, podfile_properties['ios.deploymentTarget'] || '12.4'\n+ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'\n+ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = '1' if podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == 'true'\n+\n+platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'\n install! 'cocoapods',\n :deterministic_uuids => false\n \n+prepare_react_native_project!\n+\n+# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.\n+# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,\n+# you can also exclude `react-native-flipper` in `react-native.config.js`\n+#\n+# ```js\n+# module.exports = {\n+# dependencies: {\n+# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),\n+# }\n+# }\n+# ```\n+flipper_config = FlipperConfiguration.disabled\n+if ENV['NO_FLIPPER'] == '1' then\n+ # Explicitly disabled through environment variables\n+ flipper_config = FlipperConfiguration.disabled\n+elsif podfile_properties.key?('ios.flipper') then\n+ # Configure Flipper in Podfile.properties.json\n+ if podfile_properties['ios.flipper'] == 'true' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"])\n+ elsif podfile_properties['ios.flipper'] != 'false' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"], { 'Flipper' => podfile_properties['ios.flipper'] })\n+ end\n+end\n+\n target 'HelloWorld' do\n use_expo_modules!\n config = use_native_modules!\n \n use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']\n+ use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']\n \n # Flags change depending on the env values.\n flags = get_default_flags()\n \n use_react_native!(\n :path => config[:reactNativePath],\n- :hermes_enabled => flags[:hermes_enabled] || podfile_properties['expo.jsEngine'] == 'hermes',\n+ :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',\n :fabric_enabled => flags[:fabric_enabled],\n # An absolute path to your application root.\n- :app_path => \"#{Dir.pwd}/..\"\n+ :app_path => \"#{Pod::Config.instance.installation_root}/..\",\n+ # Note that if you have use_frameworks! enabled, Flipper will not work if enabled\n+ :flipper_configuration => flipper_config\n )\n \n- # Uncomment to opt-in to using Flipper\n- # Note that if you have use_frameworks! enabled, Flipper will not work\n- #\n- # if !ENV['CI']\n- # use_flipper!()\n- # end\n-\n post_install do |installer|\n- react_native_post_install(installer)\n+ react_native_post_install(\n+ installer,\n+ config[:reactNativePath],\n+ # Set `mac_catalyst_enabled` to `true` in order to apply patches\n+ # necessary for Mac Catalyst builds\n+ :mac_catalyst_enabled => false\n+ )\n __apply_Xcode_12_5_M1_post_install_workaround(installer)\n \n # This is necessary for Xcode 14, because it signs resource bundles by default\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile.properties.json b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\nindex f6d872e81a..b1bd45da51 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n+++ b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n@@ -1,3 +1,3 @@\n {\n- \"expo.jsEngine\": \"jsc\"\n+ \"expo.jsEngine\": \"hermes\"\n }\ndiff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json\nindex d5ca09a584..d1fcd513cc 100644\n--- a/templates/expo-template-bare-minimum/package.json\n+++ b/templates/expo-template-bare-minimum/package.json\n@@ -1,7 +1,7 @@\n {\n \"name\": \"expo-template-bare-minimum\",\n \"description\": \"This bare project template includes a minimal setup for using unimodules with React Native.\",\n- \"version\": \"46.0.37\",\n+ \"version\": \"48.0.21\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"expo start --dev-client\",\n@@ -10,15 +10,13 @@\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n- \"expo\": \"~46.0.21\",\n- \"expo-splash-screen\": \"~0.16.2\",\n- \"expo-status-bar\": \"~1.4.0\",\n- \"react\": \"18.0.0\",\n- \"react-dom\": \"18.0.0\",\n- \"react-native\": \"0.69.9\",\n- \"react-native-web\": \"~0.18.7\"\n+ \"expo\": \"~48.0.21\",\n+ \"expo-splash-screen\": \"~0.18.2\",\n+ \"expo-status-bar\": \"~1.4.4\",\n+ \"react\": \"18.2.0\",\n+ \"react-native\": \"0.71.14\"\n },\n \"devDependencies\": {\n- \"@babel/core\": \"^7.12.9\"\n+ \"@babel/core\": \"^7.20.0\"\n }\n }\n","47..48":"diff --git a/templates/expo-template-bare-minimum/.buckconfig b/templates/expo-template-bare-minimum/.buckconfig\ndeleted file mode 100644\nindex 934256cb29..0000000000\n--- a/templates/expo-template-bare-minimum/.buckconfig\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-\n-[android]\n- target = Google Inc.:Google APIs:23\n-\n-[maven_repositories]\n- central = https://repo1.maven.org/maven2\ndiff --git a/templates/expo-template-bare-minimum/.npmignore b/templates/expo-template-bare-minimum/.npmignore\nindex 35490b6612..4e6ce00391 100644\n--- a/templates/expo-template-bare-minimum/.npmignore\n+++ b/templates/expo-template-bare-minimum/.npmignore\n@@ -20,3 +20,4 @@ ios/Pods\n android/.build\n android/app/build\n android/.gradle\n+ios/.xcode.env.local\ndiff --git a/templates/expo-template-bare-minimum/android/app/BUCK b/templates/expo-template-bare-minimum/android/app/BUCK\ndeleted file mode 100644\nindex 0e77904834..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/BUCK\n+++ /dev/null\n@@ -1,55 +0,0 @@\n-# To learn about Buck see [Docs](https://buckbuild.com/).\n-# To run your application with Buck:\n-# - install Buck\n-# - `npm start` - to start the packager\n-# - `cd android`\n-# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\"`\n-# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck\n-# - `buck install -r android/app` - compile, install and run application\n-#\n-\n-load(\":build_defs.bzl\", \"create_aar_targets\", \"create_jar_targets\")\n-\n-lib_deps = []\n-\n-create_aar_targets(glob([\"libs/*.aar\"]))\n-\n-create_jar_targets(glob([\"libs/*.jar\"]))\n-\n-android_library(\n- name = \"all-libs\",\n- exported_deps = lib_deps,\n-)\n-\n-android_library(\n- name = \"app-code\",\n- srcs = glob([\n- \"src/main/java/**/*.java\",\n- ]),\n- deps = [\n- \":all-libs\",\n- \":build_config\",\n- \":res\",\n- ],\n-)\n-\n-android_build_config(\n- name = \"build_config\",\n- package = \"com.helloworld\",\n-)\n-\n-android_resource(\n- name = \"res\",\n- package = \"com.helloworld\",\n- res = \"src/main/res\",\n-)\n-\n-android_binary(\n- name = \"app\",\n- keystore = \"//android/keystores:debug\",\n- manifest = \"src/main/AndroidManifest.xml\",\n- package_type = \"debug\",\n- deps = [\n- \":app-code\",\n- ],\n-)\ndiff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex 648135611c..189390e7e3 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -1,135 +1,107 @@\n apply plugin: \"com.android.application\"\n+apply plugin: \"com.facebook.react\"\n \n import com.android.build.OutputFile\n \n-/**\n- * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n- * and bundleReleaseJsAndAssets).\n- * These basically call `react-native bundle` with the correct arguments during the Android build\n- * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the\n- * bundle directly from the development server. Below you can see all the possible configurations\n- * and their defaults. If you decide to add a configuration block, make sure to add it before the\n- * `apply from: \"../../node_modules/react-native/react.gradle\"` line.\n- *\n- * project.ext.react = [\n- * // the name of the generated asset file containing your JS bundle\n- * bundleAssetName: \"index.android.bundle\",\n- *\n- * // the entry file for bundle generation. If none specified and\n- * // \"index.android.js\" exists, it will be used. Otherwise \"index.js\" is\n- * // default. Can be overridden with ENTRY_FILE environment variable.\n- * entryFile: \"index.android.js\",\n- *\n- * // https://reactnative.dev/docs/performance#enable-the-ram-format\n- * bundleCommand: \"ram-bundle\",\n- *\n- * // whether to bundle JS and assets in debug mode\n- * bundleInDebug: false,\n- *\n- * // whether to bundle JS and assets in release mode\n- * bundleInRelease: true,\n- *\n- * // whether to bundle JS and assets in another build variant (if configured).\n- * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants\n- * // The configuration property can be in the following formats\n- * // 'bundleIn${productFlavor}${buildType}'\n- * // 'bundleIn${buildType}'\n- * // bundleInFreeDebug: true,\n- * // bundleInPaidRelease: true,\n- * // bundleInBeta: true,\n- *\n- * // whether to disable dev mode in custom build variants (by default only disabled in release)\n- * // for example: to disable dev mode in the staging build type (if configured)\n- * devDisabledInStaging: true,\n- * // The configuration property can be in the following formats\n- * // 'devDisabledIn${productFlavor}${buildType}'\n- * // 'devDisabledIn${buildType}'\n- *\n- * // the root of your project, i.e. where \"package.json\" lives\n- * root: \"../../\",\n- *\n- * // where to put the JS bundle asset in debug mode\n- * jsBundleDirDebug: \"$buildDir/intermediates/assets/debug\",\n- *\n- * // where to put the JS bundle asset in release mode\n- * jsBundleDirRelease: \"$buildDir/intermediates/assets/release\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in debug mode\n- * resourcesDirDebug: \"$buildDir/intermediates/res/merged/debug\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in release mode\n- * resourcesDirRelease: \"$buildDir/intermediates/res/merged/release\",\n- *\n- * // by default the gradle tasks are skipped if none of the JS files or assets change; this means\n- * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to\n- * // date; if you have any other folders that you want to ignore for performance reasons (gradle\n- * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/\n- * // for example, you might want to remove it from here.\n- * inputExcludes: [\"android/**\", \"ios/**\"],\n- *\n- * // override which node gets called and with what additional arguments\n- * nodeExecutableAndArgs: [\"node\"],\n- *\n- * // supply additional arguments to the packager\n- * extraPackagerArgs: []\n- * ]\n- */\n-\n def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()\n+def expoDebuggableVariants = ['debug']\n+// Override `debuggableVariants` for expo-updates debugging\n+if (System.getenv('EX_UPDATES_NATIVE_DEBUG') == \"1\") {\n+ react {\n+ expoDebuggableVariants = []\n+ }\n+}\n \n-def reactNativeRoot = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath()\n \n-project.ext.react = [\n- entryFile: [\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\"].execute(null, rootDir).text.trim(),\n- enableHermes: (findProperty('expo.jsEngine') ?: \"jsc\") == \"hermes\",\n- hermesCommand: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\",\n- cliPath: \"${reactNativeRoot}/cli.js\",\n- composeSourceMapsPath: \"${reactNativeRoot}/scripts/compose-source-maps.js\",\n-]\n+/**\n+ * This is the configuration block to customize your React Native Android app.\n+ * By default you don't need to apply any configuration, just uncomment the lines you need.\n+ */\n+react {\n+ entryFile = file([\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\", \"absolute\"].execute(null, rootDir).text.trim())\n+ reactNativeDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()\n+ hermesCommand = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\"\n+ debuggableVariants = expoDebuggableVariants\n+\n+ /* Folders */\n+ // The root of your project, i.e. where \"package.json\" lives. Default is '..'\n+ // root = file(\"../\")\n+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native\n+ // reactNativeDir = file(\"../node_modules/react-native\")\n+ // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen\n+ // codegenDir = file(\"../node_modules/react-native-codegen\")\n+ // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js\n+ // cliFile = file(\"../node_modules/react-native/cli.js\")\n+\n+ /* Variants */\n+ // The list of variants to that are debuggable. For those we're going to\n+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.\n+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.\n+ // debuggableVariants = [\"liteDebug\", \"prodDebug\"]\n+\n+ /* Bundling */\n+ // A list containing the node command and its flags. Default is just 'node'.\n+ // nodeExecutableAndArgs = [\"node\"]\n+ //\n+ // The command to run when bundling. By default is 'bundle'\n+ // bundleCommand = \"ram-bundle\"\n+ //\n+ // The path to the CLI configuration file. Default is empty.\n+ // bundleConfig = file(../rn-cli.config.js)\n+ //\n+ // The name of the generated asset file containing your JS bundle\n+ // bundleAssetName = \"MyApplication.android.bundle\"\n+ //\n+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'\n+ // entryFile = file(\"../js/MyApplication.android.js\")\n+ //\n+ // A list of extra flags to pass to the 'bundle' commands.\n+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle\n+ // extraPackagerArgs = []\n+\n+ /* Hermes Commands */\n+ // The hermes compiler command to run. By default it is 'hermesc'\n+ // hermesCommand = \"$rootDir/my-custom-hermesc/bin/hermesc\"\n+ //\n+ // The list of flags to pass to the Hermes compiler. By default is \"-O\", \"-output-source-map\"\n+ // hermesFlags = [\"-O\", \"-output-source-map\"]\n+}\n \n-apply from: new File(reactNativeRoot, \"react.gradle\")\n+// Override `hermesEnabled` by `expo.jsEngine`\n+ext {\n+ hermesEnabled = (findProperty('expo.jsEngine') ?: \"hermes\") == \"hermes\"\n+}\n \n /**\n- * Set this to true to create two separate APKs instead of one:\n- * - An APK that only works on ARM devices\n- * - An APK that only works on x86 devices\n- * The advantage is the size of the APK is reduced by about 4MB.\n- * Upload all the APKs to the Play Store and people will download\n- * the correct one based on the CPU architecture of their device.\n+ * Set this to true to create four separate APKs instead of one,\n+ * one for each native architecture. This is useful if you don't\n+ * use App Bundles (https://developer.android.com/guide/app-bundle/)\n+ * and want to have separate APKs to upload to the Play Store.\n */\n def enableSeparateBuildPerCPUArchitecture = false\n \n /**\n- * Run Proguard to shrink the Java bytecode in release builds.\n+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.\n */\n def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()\n \n /**\n- * The preferred build flavor of JavaScriptCore.\n+ * The preferred build flavor of JavaScriptCore (JSC)\n *\n * For example, to use the international variant, you can use:\n * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`\n *\n * The international variant includes ICU i18n library and necessary data\n * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that\n- * give correct results when using with locales other than en-US. Note that\n+ * give correct results when using with locales other than en-US. Note that\n * this variant is about 6MiB larger per architecture than default.\n */\n def jscFlavor = 'org.webkit:android-jsc:+'\n \n /**\n- * Whether to enable the Hermes VM.\n- *\n- * This should be set on project.ext.react and that value will be read here. If it is not set\n- * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode\n- * and the benefits of using Hermes will therefore be sharply reduced.\n- */\n-def enableHermes = project.ext.react.get(\"enableHermes\", false);\n-\n-/**\n- * Architectures to build native code for.\n+ * Private function to get the list of Native Architectures you want to build.\n+ * This reads the value from reactNativeArchitectures in your gradle.properties\n+ * file and works together with the --active-arch-only flag of react-native run-android.\n */\n def reactNativeArchitectures() {\n def value = project.getProperties().get(\"reactNativeArchitectures\")\n@@ -141,72 +113,13 @@ android {\n \n compileSdkVersion rootProject.ext.compileSdkVersion\n \n+ namespace \"com.helloworld\"\n defaultConfig {\n applicationId \"com.helloworld\"\n minSdkVersion rootProject.ext.minSdkVersion\n targetSdkVersion rootProject.ext.targetSdkVersion\n versionCode 1\n versionName \"1.0\"\n- buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the CMake build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- cmake {\n- arguments \"-DPROJECT_BUILD_DIR=$buildDir\",\n- \"-DREACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid\",\n- \"-DREACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build\",\n- \"-DNODE_MODULES_DIR=$rootDir/../node_modules\",\n- \"-DANDROID_STL=c++_shared\"\n- }\n- }\n- if (!enableSeparateBuildPerCPUArchitecture) {\n- ndk {\n- abiFilters (*reactNativeArchitectures())\n- }\n- }\n- }\n- }\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the CMake build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- cmake {\n- path \"$projectDir/src/main/jni/CMakeLists.txt\"\n- }\n- }\n- def reactAndroidProjectDir = project(':ReactAndroid').projectDir\n- def packageReactNdkDebugLibs = tasks.register(\"packageReactNdkDebugLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkDebugLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- def packageReactNdkReleaseLibs = tasks.register(\"packageReactNdkReleaseLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkReleaseLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- afterEvaluate {\n- // If you wish to add a custom TurboModule or component locally,\n- // you should uncomment this line.\n- // preBuild.dependsOn(\"generateCodegenArtifactsFromSchema\")\n- preDebugBuild.dependsOn(packageReactNdkDebugLibs)\n- preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)\n-\n- // Due to a bug inside AGP, we have to explicitly set a dependency\n- // between configureCMakeDebug* tasks and the preBuild tasks.\n- // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732\n- configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)\n- configureCMakeDebug.dependsOn(preDebugBuild)\n- reactNativeArchitectures().each { architecture ->\n- tasks.findByName(\"configureCMakeDebug[${architecture}]\")?.configure {\n- dependsOn(\"preDebugBuild\")\n- }\n- tasks.findByName(\"configureCMakeRelWithDebInfo[${architecture}]\")?.configure {\n- dependsOn(\"preReleaseBuild\")\n- }\n- }\n- }\n }\n \n splits {\n@@ -233,6 +146,7 @@ android {\n // Caution! In production, you need to generate your own keystore file.\n // see https://reactnative.dev/docs/signed-apk-android.\n signingConfig signingConfigs.debug\n+ shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)\n minifyEnabled enableProguardInReleaseBuilds\n proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n }\n@@ -243,11 +157,12 @@ android {\n variant.outputs.each { output ->\n // For each separate APK per architecture, set a unique version code as described here:\n // https://developer.android.com/studio/build/configure-apk-splits.html\n+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.\n def versionCodes = [\"armeabi-v7a\": 1, \"x86\": 2, \"arm64-v8a\": 3, \"x86_64\": 4]\n def abi = output.getFilter(OutputFile.ABI)\n if (abi != null) { // null for the universal-debug, universal-release variants\n output.versionCodeOverride =\n- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)\n }\n \n }\n@@ -275,10 +190,8 @@ android {\n }\n \n dependencies {\n- implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n-\n- //noinspection GradleDynamicVersion\n- implementation \"com.facebook.react:react-native:+\" // From node_modules\n+ // The version of react-native is set by the React Native Gradle Plugin\n+ implementation(\"com.facebook.react:react-android\")\n \n def isGifEnabled = (findProperty('expo.gif.enabled') ?: \"\") == \"true\";\n def isWebpEnabled = (findProperty('expo.webp.enabled') ?: \"\") == \"true\";\n@@ -287,76 +200,38 @@ dependencies {\n \n // If your app supports Android versions before Ice Cream Sandwich (API level 14)\n if (isGifEnabled || isWebpEnabled) {\n- implementation \"com.facebook.fresco:fresco:${frescoVersion}\"\n- implementation \"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:fresco:${frescoVersion}\")\n+ implementation(\"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\")\n }\n \n if (isGifEnabled) {\n // For animated gif support\n- implementation \"com.facebook.fresco:animated-gif:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-gif:${frescoVersion}\")\n }\n \n if (isWebpEnabled) {\n // For webp support\n- implementation \"com.facebook.fresco:webpsupport:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:webpsupport:${frescoVersion}\")\n if (isWebpAnimatedEnabled) {\n // Animated webp support\n- implementation \"com.facebook.fresco:animated-webp:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-webp:${frescoVersion}\")\n }\n }\n \n- implementation \"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\"\n- debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.fbjni'\n- }\n+ implementation(\"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\")\n+\n+ debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\")\n debugImplementation(\"com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n exclude group:'com.squareup.okhttp3', module:'okhttp'\n }\n- debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n- }\n+ debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\")\n \n- if (enableHermes) {\n- //noinspection GradleDynamicVersion\n- implementation(\"com.facebook.react:hermes-engine:+\") { // From node_modules\n- exclude group:'com.facebook.fbjni'\n- }\n+ if (hermesEnabled.toBoolean()) {\n+ implementation(\"com.facebook.react:hermes-android\")\n } else {\n implementation jscFlavor\n }\n }\n \n-if (isNewArchitectureEnabled()) {\n- // If new architecture is enabled, we let you build RN from source\n- // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.\n- // This will be applied to all the imported transtitive dependency.\n- configurations.all {\n- resolutionStrategy.dependencySubstitution {\n- substitute(module(\"com.facebook.react:react-native\"))\n- .using(project(\":ReactAndroid\"))\n- .because(\"On New Architecture we're building React Native from source\")\n- substitute(module(\"com.facebook.react:hermes-engine\"))\n- .using(project(\":ReactAndroid:hermes-engine\"))\n- .because(\"On New Architecture we're building Hermes from source\")\n- }\n- }\n-}\n-\n-// Run this once to be able to run the application with BUCK\n-// puts all compile dependencies into folder libs for BUCK to use\n-task copyDownloadableDepsToLibs(type: Copy) {\n- from configurations.implementation\n- into 'libs'\n-}\n-\n apply from: new File([\"node\", \"--print\", \"require.resolve('@react-native-community/cli-platform-android/package.json')\"].execute(null, rootDir).text.trim(), \"../native_modules.gradle\");\n applyNativeModulesAppBuildGradle(project)\n-\n-def isNewArchitectureEnabled() {\n- // To opt-in for the New Architecture, you can either:\n- // - Set `newArchEnabled` to true inside the `gradle.properties` file\n- // - Invoke gradle with `-newArchEnabled=true`\n- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`\n- return project.hasProperty(\"newArchEnabled\") && project.newArchEnabled == \"true\"\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/build_defs.bzl b/templates/expo-template-bare-minimum/android/app/build_defs.bzl\ndeleted file mode 100644\nindex fff270f8d1..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/build_defs.bzl\n+++ /dev/null\n@@ -1,19 +0,0 @@\n-\"\"\"Helper definitions to glob .aar and .jar targets\"\"\"\n-\n-def create_aar_targets(aarfiles):\n- for aarfile in aarfiles:\n- name = \"aars__\" + aarfile[aarfile.rindex(\"/\") + 1:aarfile.rindex(\".aar\")]\n- lib_deps.append(\":\" + name)\n- android_prebuilt_aar(\n- name = name,\n- aar = aarfile,\n- )\n-\n-def create_jar_targets(jarfiles):\n- for jarfile in jarfiles:\n- name = \"jars__\" + jarfile[jarfile.rindex(\"/\") + 1:jarfile.rindex(\".jar\")]\n- lib_deps.append(\":\" + name)\n- prebuilt_jar(\n- name = name,\n- binary_jar = jarfile,\n- )\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\nindex 8cddb11cb2..595dd5831c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n@@ -1,5 +1,5 @@\n /**\n- * Copyright (c) Facebook, Inc. and its affiliates.\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *

This source code is licensed under the MIT license found in the LICENSE file in the root\n * directory of this source tree.\n@@ -17,22 +17,27 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping;\n import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;\n import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;\n import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;\n-import com.facebook.flipper.plugins.react.ReactFlipperPlugin;\n import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;\n+import com.facebook.react.ReactInstanceEventListener;\n import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.bridge.ReactContext;\n import com.facebook.react.modules.network.NetworkingModule;\n import okhttp3.OkHttpClient;\n \n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the debug\n+ * flavor of it. Here you can add your own plugins and customize the Flipper setup.\n+ */\n public class ReactNativeFlipper {\n public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n if (FlipperUtils.shouldEnableFlipper(context)) {\n final FlipperClient client = AndroidFlipperClient.getInstance(context);\n+\n client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));\n- client.addPlugin(new ReactFlipperPlugin());\n client.addPlugin(new DatabasesFlipperPlugin(context));\n client.addPlugin(new SharedPreferencesFlipperPlugin(context));\n client.addPlugin(CrashReporterPlugin.getInstance());\n+\n NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();\n NetworkingModule.setCustomClientBuilder(\n new NetworkingModule.CustomClientBuilder() {\n@@ -43,12 +48,13 @@ public class ReactNativeFlipper {\n });\n client.addPlugin(networkFlipperPlugin);\n client.start();\n+\n // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized\n // Hence we run if after all native modules have been initialized\n ReactContext reactContext = reactInstanceManager.getCurrentReactContext();\n if (reactContext == null) {\n reactInstanceManager.addReactInstanceEventListener(\n- new ReactInstanceManager.ReactInstanceEventListener() {\n+ new ReactInstanceEventListener() {\n @Override\n public void onReactContextInitialized(ReactContext reactContext) {\n reactInstanceManager.removeReactInstanceEventListener(this);\n@@ -66,4 +72,4 @@ public class ReactNativeFlipper {\n }\n }\n }\n-}\n\\ No newline at end of file\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\nindex 0cad655b33..6536fc03ad 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n@@ -1,4 +1,4 @@\n-\n+\n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 8e13797d9b..7e2823fb6c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -29,15 +30,20 @@ public class MainActivity extends ReactActivity {\n }\n \n /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled\n+ // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).\n+ DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled\n+ ));\n }\n \n /**\n@@ -59,25 +65,4 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..31c2b288c1 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,70 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \"index\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +73,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\ndeleted file mode 100644\nindex d2cad3a326..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-cmake_minimum_required(VERSION 3.13)\n-\n-# Define the library name here.\n-project(helloworld_appmodules)\n-\n-# This file includes all the necessary to let you build your application with the New Architecture.\n-include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 26162dd872..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n-\n- // Module providers autolinked by RN CLI\n- auto rncli_module = rncli_ModuleProvider(moduleName, params);\n- if (rncli_module != nullptr) {\n- return rncli_module;\n- }\n-\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex b38ccf53fd..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex 5fd688c509..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- const std::string &name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 9ee38a81f6..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(const std::string &name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 54f598a486..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,65 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Autolinked providers registered by RN CLI\n- rncli_registerProviders(providerRegistry);\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\nnew file mode 100644\nindex 0000000000..b510364404\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\n@@ -0,0 +1,20 @@\n+/**\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n+ *\n+ *

This source code is licensed under the MIT license found in the LICENSE file in the root\n+ * directory of this source tree.\n+ */\n+package com.helloworld;\n+\n+import android.content.Context;\n+import com.facebook.react.ReactInstanceManager;\n+\n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the release\n+ * flavor of it so it's empty as we don't want to load Flipper.\n+ */\n+public class ReactNativeFlipper {\n+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n+ // Do nothing as we don't want to initialize Flipper on Release.\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/build.gradle b/templates/expo-template-bare-minimum/android/build.gradle\nindex 8181b282cd..e5fda82878 100644\n--- a/templates/expo-template-bare-minimum/android/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/build.gradle\n@@ -2,47 +2,30 @@\n \n buildscript {\n ext {\n- buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'\n+ buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0'\n minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')\n- compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')\n- targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')\n+ compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33')\n+ targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33')\n if (findProperty('android.kotlinVersion')) {\n kotlinVersion = findProperty('android.kotlinVersion')\n }\n frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'\n \n- if (System.properties['os.arch'] == 'aarch64') {\n- // For M1 Users we need to use the NDK 24 which added support for aarch64\n- ndkVersion = '24.0.8215888'\n- } else {\n- // Otherwise we default to the side-by-side NDK version from AGP.\n- ndkVersion = '21.4.7075529'\n- }\n+ // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.\n+ ndkVersion = \"23.1.7779620\"\n }\n repositories {\n google()\n mavenCentral()\n }\n dependencies {\n- classpath('com.android.tools.build:gradle:7.2.1')\n+ classpath('com.android.tools.build:gradle:7.4.1')\n classpath('com.facebook.react:react-native-gradle-plugin')\n- classpath('de.undercouch:gradle-download-task:5.0.1')\n- // NOTE: Do not place your application dependencies here; they belong\n- // in the individual module build.gradle files\n }\n }\n \n-def REACT_NATIVE_VERSION = new File(['node', '--print', \"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n-\n allprojects {\n- configurations.all {\n- resolutionStrategy {\n- force \"com.facebook.react:react-native:\" + REACT_NATIVE_VERSION\n- }\n- }\n-\n repositories {\n- mavenLocal()\n maven {\n // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm\n url(new File(['node', '--print', \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), '../android'))\n@@ -53,13 +36,7 @@ allprojects {\n }\n \n google()\n- mavenCentral {\n- // We don't want to fetch react-native from Maven Central as there are\n- // older versions over there.\n- content {\n- excludeGroup 'com.facebook.react'\n- }\n- }\n+ mavenCentral()\n maven { url 'https://www.jitpack.io' }\n }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/gitignore b/templates/expo-template-bare-minimum/android/gitignore\nindex 64436baaf5..877b87e9a5 100644\n--- a/templates/expo-template-bare-minimum/android/gitignore\n+++ b/templates/expo-template-bare-minimum/android/gitignore\n@@ -11,11 +11,5 @@ local.properties\n *.iml\n *.hprof\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/android/gradle.properties b/templates/expo-template-bare-minimum/android/gradle.properties\nindex fab3fb6bcf..9911ac4afd 100644\n--- a/templates/expo-template-bare-minimum/android/gradle.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle.properties\n@@ -42,7 +42,7 @@ newArchEnabled=false\n \n # The hosted JavaScript engine\n # Supported values: expo.jsEngine = \"hermes\" | \"jsc\"\n-expo.jsEngine=jsc\n+expo.jsEngine=hermes\n \n # Enable GIF support in React Native images (~200 B increase)\n expo.gif.enabled=true\ndiff --git a/templates/expo-template-bare-minimum/android/settings.gradle b/templates/expo-template-bare-minimum/android/settings.gradle\nindex b3332319f9..1dc416e7c1 100644\n--- a/templates/expo-template-bare-minimum/android/settings.gradle\n+++ b/templates/expo-template-bare-minimum/android/settings.gradle\n@@ -8,10 +8,3 @@ applyNativeModulesSettingsGradle(settings)\n \n include ':app'\n includeBuild(new File([\"node\", \"--print\", \"require.resolve('react-native-gradle-plugin/package.json')\"].execute(null, rootDir).text.trim()).getParentFile())\n-\n-if (settings.hasProperty(\"newArchEnabled\") && settings.newArchEnabled == \"true\") {\n- include(\":ReactAndroid\")\n- project(\":ReactAndroid\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid\");\n- include(\":ReactAndroid:hermes-engine\")\n- project(\":ReactAndroid:hermes-engine\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid/hermes-engine\");\n-}\ndiff --git a/templates/expo-template-bare-minimum/gitignore b/templates/expo-template-bare-minimum/gitignore\nindex 67397f65f9..df57ba88a1 100644\n--- a/templates/expo-template-bare-minimum/gitignore\n+++ b/templates/expo-template-bare-minimum/gitignore\n@@ -31,6 +31,8 @@ local.properties\n *.iml\n *.hprof\n .cxx/\n+*.keystore\n+!debug.keystore\n \n # node.js\n #\n@@ -38,18 +40,15 @@ node_modules/\n npm-debug.log\n yarn-error.log\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\n \n # CocoaPods\n /ios/Pods/\n \n+# Temporary files created by Metro to check the health of the file watcher\n+.metro-health-check*\n+\n # Expo\n .expo/\n web-build/\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\nindex 62a1be2493..98e6c2afea 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n@@ -310,6 +310,7 @@\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n \t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -333,6 +334,7 @@\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n \t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\nindex f7d2972042..1658a437eb 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n@@ -1,9 +1,7 @@\n-#import \n-#import \n+#import \n #import \n-\n #import \n \n-@interface AppDelegate : EXAppDelegateWrapper \n+@interface AppDelegate : EXAppDelegateWrapper\n \n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\nindex a6e13e11ab..8cb5aef137 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n@@ -1,100 +1,40 @@\n #import \"AppDelegate.h\"\n \n-#import \n #import \n-#import \n #import \n-#import \n-\n-#import \n-\n-#if RCT_NEW_ARCH_ENABLED\n-#import \n-#import \n-#import \n-#import \n-#import \n-#import \n-\n-#import \n-\n-static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n-\n-@interface AppDelegate () {\n- RCTTurboModuleManager *_turboModuleManager;\n- RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;\n- std::shared_ptr _reactNativeConfig;\n- facebook::react::ContextContainer::Shared _contextContainer;\n-}\n-@end\n-#endif\n \n @implementation AppDelegate\n \n - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n {\n- RCTAppSetupPrepareApp(application);\n-\n- RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];\n-\n-#if RCT_NEW_ARCH_ENABLED\n- _contextContainer = std::make_shared();\n- _reactNativeConfig = std::make_shared();\n- _contextContainer->insert(\"ReactNativeConfig\", _reactNativeConfig);\n- _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];\n- bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;\n-#endif\n-\n- NSDictionary *initProps = [self prepareInitialProps];\n- UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:initProps];\n-\n- rootView.backgroundColor = [UIColor whiteColor];\n- self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n- UIViewController *rootViewController = [self.reactDelegate createRootViewController];\n- rootViewController.view = rootView;\n- self.window.rootViewController = rootViewController;\n- [self.window makeKeyAndVisible];\n+ self.moduleName = @\"main\";\n \n- [super application:application didFinishLaunchingWithOptions:launchOptions];\n+ // You can add your custom initial props in the dictionary below.\n+ // They will be passed down to the ViewController used by React Native.\n+ self.initialProps = @{};\n \n- return YES;\n+ return [super application:application didFinishLaunchingWithOptions:launchOptions];\n }\n \n-- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge\n+- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n {\n- // If you'd like to export some custom RCTBridgeModules, add them here!\n- return @[];\n+#if DEBUG\n+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n+#else\n+ return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n+#endif\n }\n \n /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.\n ///\n /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html\n /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).\n-/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.\n+/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.\n - (BOOL)concurrentRootEnabled\n {\n- // Switch this bool to turn on and off the concurrent root\n return true;\n }\n \n-- (NSDictionary *)prepareInitialProps\n-{\n- NSMutableDictionary *initProps = [NSMutableDictionary new];\n-#if RCT_NEW_ARCH_ENABLED\n- initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);\n-#endif\n- return initProps;\n-}\n-\n-- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n-{\n-#if DEBUG\n- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n-#else\n- return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n-#endif\n-}\n-\n // Linking API\n - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options {\n return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];\n@@ -124,43 +64,4 @@ static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];\n }\n \n-#if RCT_NEW_ARCH_ENABLED\n-\n-#pragma mark - RCTCxxBridgeDelegate\n-\n-- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge\n-{\n- _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge\n- delegate:self\n- jsInvoker:bridge.jsCallInvoker];\n- return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);\n-}\n-\n-#pragma mark RCTTurboModuleManagerDelegate\n-\n-- (Class)getModuleClassFromName:(const char *)name\n-{\n- return RCTCoreModulesClassProvider(name);\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- jsInvoker:(std::shared_ptr)jsInvoker\n-{\n- return nullptr;\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- initParams:\n- (const facebook::react::ObjCTurboModule::InitParams &)params\n-{\n- return nullptr;\n-}\n-\n-- (id)getModuleInstanceFromClass:(Class)moduleClass\n-{\n- return RCTAppSetupDefaultModuleFromClass(moduleClass);\n-}\n-\n-#endif\n-\n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile b/templates/expo-template-bare-minimum/ios/Podfile\nindex 474455b90d..e523ea5cac 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile\n+++ b/templates/expo-template-bare-minimum/ios/Podfile\n@@ -5,34 +5,63 @@ require File.join(File.dirname(`node --print \"require.resolve('@react-native-com\n require 'json'\n podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}\n \n+ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'\n+ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = '1' if podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == 'true'\n+\n platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'\n install! 'cocoapods',\n :deterministic_uuids => false\n \n+prepare_react_native_project!\n+\n+# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.\n+# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,\n+# you can also exclude `react-native-flipper` in `react-native.config.js`\n+#\n+# ```js\n+# module.exports = {\n+# dependencies: {\n+# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),\n+# }\n+# }\n+# ```\n+flipper_config = FlipperConfiguration.disabled\n+if ENV['NO_FLIPPER'] == '1' then\n+ # Explicitly disabled through environment variables\n+ flipper_config = FlipperConfiguration.disabled\n+elsif podfile_properties.key?('ios.flipper') then\n+ # Configure Flipper in Podfile.properties.json\n+ if podfile_properties['ios.flipper'] == 'true' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"])\n+ elsif podfile_properties['ios.flipper'] != 'false' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"], { 'Flipper' => podfile_properties['ios.flipper'] })\n+ end\n+end\n+\n target 'HelloWorld' do\n use_expo_modules!\n config = use_native_modules!\n \n use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']\n+ use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']\n \n # Flags change depending on the env values.\n flags = get_default_flags()\n \n use_react_native!(\n :path => config[:reactNativePath],\n- :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes',\n+ :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',\n :fabric_enabled => flags[:fabric_enabled],\n # An absolute path to your application root.\n :app_path => \"#{Pod::Config.instance.installation_root}/..\",\n- #\n- # Uncomment to opt-in to using Flipper\n- # Note that if you have use_frameworks! enabled, Flipper will not work\n- # :flipper_configuration => !ENV['CI'] ? FlipperConfiguration.enabled : FlipperConfiguration.disabled,\n+ # Note that if you have use_frameworks! enabled, Flipper will not work if enabled\n+ :flipper_configuration => flipper_config\n )\n \n post_install do |installer|\n react_native_post_install(\n installer,\n+ config[:reactNativePath],\n # Set `mac_catalyst_enabled` to `true` in order to apply patches\n # necessary for Mac Catalyst builds\n :mac_catalyst_enabled => false\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile.properties.json b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\nindex f6d872e81a..b1bd45da51 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n+++ b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n@@ -1,3 +1,3 @@\n {\n- \"expo.jsEngine\": \"jsc\"\n+ \"expo.jsEngine\": \"hermes\"\n }\ndiff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json\nindex a41fdc0d8d..d1fcd513cc 100644\n--- a/templates/expo-template-bare-minimum/package.json\n+++ b/templates/expo-template-bare-minimum/package.json\n@@ -1,7 +1,7 @@\n {\n \"name\": \"expo-template-bare-minimum\",\n \"description\": \"This bare project template includes a minimal setup for using unimodules with React Native.\",\n- \"version\": \"47.0.26\",\n+ \"version\": \"48.0.21\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"expo start --dev-client\",\n@@ -10,13 +10,13 @@\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n- \"expo\": \"~47.0.14\",\n- \"expo-splash-screen\": \"~0.17.5\",\n- \"expo-status-bar\": \"~1.4.2\",\n- \"react\": \"18.1.0\",\n- \"react-native\": \"0.70.8\"\n+ \"expo\": \"~48.0.21\",\n+ \"expo-splash-screen\": \"~0.18.2\",\n+ \"expo-status-bar\": \"~1.4.4\",\n+ \"react\": \"18.2.0\",\n+ \"react-native\": \"0.71.14\"\n },\n \"devDependencies\": {\n- \"@babel/core\": \"^7.12.9\"\n+ \"@babel/core\": \"^7.20.0\"\n }\n }\n","48..48":"","45..49":"diff --git a/templates/expo-template-bare-minimum/.buckconfig b/templates/expo-template-bare-minimum/.buckconfig\ndeleted file mode 100644\nindex 934256cb29..0000000000\n--- a/templates/expo-template-bare-minimum/.buckconfig\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-\n-[android]\n- target = Google Inc.:Google APIs:23\n-\n-[maven_repositories]\n- central = https://repo1.maven.org/maven2\ndiff --git a/templates/expo-template-bare-minimum/.npmignore b/templates/expo-template-bare-minimum/.npmignore\nindex 35490b6612..bc0b76356d 100644\n--- a/templates/expo-template-bare-minimum/.npmignore\n+++ b/templates/expo-template-bare-minimum/.npmignore\n@@ -17,6 +17,8 @@ web-build/\n HelloWorld.xcworkspace\n Podfile.lock\n ios/Pods\n+ios/.xcode.env.local\n android/.build\n android/app/build\n android/.gradle\n+ios/.xcode.env.local\ndiff --git a/templates/expo-template-bare-minimum/android/app/BUCK b/templates/expo-template-bare-minimum/android/app/BUCK\ndeleted file mode 100644\nindex 0e77904834..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/BUCK\n+++ /dev/null\n@@ -1,55 +0,0 @@\n-# To learn about Buck see [Docs](https://buckbuild.com/).\n-# To run your application with Buck:\n-# - install Buck\n-# - `npm start` - to start the packager\n-# - `cd android`\n-# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\"`\n-# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck\n-# - `buck install -r android/app` - compile, install and run application\n-#\n-\n-load(\":build_defs.bzl\", \"create_aar_targets\", \"create_jar_targets\")\n-\n-lib_deps = []\n-\n-create_aar_targets(glob([\"libs/*.aar\"]))\n-\n-create_jar_targets(glob([\"libs/*.jar\"]))\n-\n-android_library(\n- name = \"all-libs\",\n- exported_deps = lib_deps,\n-)\n-\n-android_library(\n- name = \"app-code\",\n- srcs = glob([\n- \"src/main/java/**/*.java\",\n- ]),\n- deps = [\n- \":all-libs\",\n- \":build_config\",\n- \":res\",\n- ],\n-)\n-\n-android_build_config(\n- name = \"build_config\",\n- package = \"com.helloworld\",\n-)\n-\n-android_resource(\n- name = \"res\",\n- package = \"com.helloworld\",\n- res = \"src/main/res\",\n-)\n-\n-android_binary(\n- name = \"app\",\n- keystore = \"//android/keystores:debug\",\n- manifest = \"src/main/AndroidManifest.xml\",\n- package_type = \"debug\",\n- deps = [\n- \":app-code\",\n- ],\n-)\ndiff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex 346fb02564..7105aaaa3f 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -1,232 +1,95 @@\n apply plugin: \"com.android.application\"\n-\n-import com.android.build.OutputFile\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n-/**\n- * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n- * and bundleReleaseJsAndAssets).\n- * These basically call `react-native bundle` with the correct arguments during the Android build\n- * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the\n- * bundle directly from the development server. Below you can see all the possible configurations\n- * and their defaults. If you decide to add a configuration block, make sure to add it before the\n- * `apply from: \"../../node_modules/react-native/react.gradle\"` line.\n- *\n- * project.ext.react = [\n- * // the name of the generated asset file containing your JS bundle\n- * bundleAssetName: \"index.android.bundle\",\n- *\n- * // the entry file for bundle generation. If none specified and\n- * // \"index.android.js\" exists, it will be used. Otherwise \"index.js\" is\n- * // default. Can be overridden with ENTRY_FILE environment variable.\n- * entryFile: \"index.android.js\",\n- *\n- * // https://reactnative.dev/docs/performance#enable-the-ram-format\n- * bundleCommand: \"ram-bundle\",\n- *\n- * // whether to bundle JS and assets in debug mode\n- * bundleInDebug: false,\n- *\n- * // whether to bundle JS and assets in release mode\n- * bundleInRelease: true,\n- *\n- * // whether to bundle JS and assets in another build variant (if configured).\n- * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants\n- * // The configuration property can be in the following formats\n- * // 'bundleIn${productFlavor}${buildType}'\n- * // 'bundleIn${buildType}'\n- * // bundleInFreeDebug: true,\n- * // bundleInPaidRelease: true,\n- * // bundleInBeta: true,\n- *\n- * // whether to disable dev mode in custom build variants (by default only disabled in release)\n- * // for example: to disable dev mode in the staging build type (if configured)\n- * devDisabledInStaging: true,\n- * // The configuration property can be in the following formats\n- * // 'devDisabledIn${productFlavor}${buildType}'\n- * // 'devDisabledIn${buildType}'\n- *\n- * // the root of your project, i.e. where \"package.json\" lives\n- * root: \"../../\",\n- *\n- * // where to put the JS bundle asset in debug mode\n- * jsBundleDirDebug: \"$buildDir/intermediates/assets/debug\",\n- *\n- * // where to put the JS bundle asset in release mode\n- * jsBundleDirRelease: \"$buildDir/intermediates/assets/release\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in debug mode\n- * resourcesDirDebug: \"$buildDir/intermediates/res/merged/debug\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in release mode\n- * resourcesDirRelease: \"$buildDir/intermediates/res/merged/release\",\n- *\n- * // by default the gradle tasks are skipped if none of the JS files or assets change; this means\n- * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to\n- * // date; if you have any other folders that you want to ignore for performance reasons (gradle\n- * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/\n- * // for example, you might want to remove it from here.\n- * inputExcludes: [\"android/**\", \"ios/**\"],\n- *\n- * // override which node gets called and with what additional arguments\n- * nodeExecutableAndArgs: [\"node\"],\n- *\n- * // supply additional arguments to the packager\n- * extraPackagerArgs: []\n- * ]\n- */\n+apply plugin: \"com.facebook.react\"\n \n def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()\n \n-project.ext.react = [\n- entryFile: [\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\"].execute(null, rootDir).text.trim(),\n- enableHermes: (findProperty('expo.jsEngine') ?: \"jsc\") == \"hermes\",\n- cliPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/cli.js\",\n- hermesCommand: new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/%OS-BIN%/hermesc\",\n- composeSourceMapsPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/scripts/compose-source-maps.js\",\n-]\n-\n-apply from: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../react.gradle\")\n-\n /**\n- * Set this to true to create two separate APKs instead of one:\n- * - An APK that only works on ARM devices\n- * - An APK that only works on x86 devices\n- * The advantage is the size of the APK is reduced by about 4MB.\n- * Upload all the APKs to the Play Store and people will download\n- * the correct one based on the CPU architecture of their device.\n+ * This is the configuration block to customize your React Native Android app.\n+ * By default you don't need to apply any configuration, just uncomment the lines you need.\n */\n-def enableSeparateBuildPerCPUArchitecture = false\n+react {\n+ entryFile = file([\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\", \"absolute\"].execute(null, rootDir).text.trim())\n+ reactNativeDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()\n+ hermesCommand = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\"\n+ codegenDir = new File([\"node\", \"--print\", \"require.resolve('@react-native/codegen/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()\n+\n+ // Use Expo CLI to bundle the app, this ensures the Metro config\n+ // works correctly with Expo projects.\n+ cliFile = new File([\"node\", \"--print\", \"require.resolve('@expo/cli')\"].execute(null, rootDir).text.trim())\n+ bundleCommand = \"export:embed\"\n+\n+ /* Folders */\n+ // The root of your project, i.e. where \"package.json\" lives. Default is '..'\n+ // root = file(\"../\")\n+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native\n+ // reactNativeDir = file(\"../node_modules/react-native\")\n+ // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen\n+ // codegenDir = file(\"../node_modules/@react-native/codegen\")\n+\n+ /* Variants */\n+ // The list of variants to that are debuggable. For those we're going to\n+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.\n+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.\n+ // debuggableVariants = [\"liteDebug\", \"prodDebug\"]\n+\n+ /* Bundling */\n+ // A list containing the node command and its flags. Default is just 'node'.\n+ // nodeExecutableAndArgs = [\"node\"]\n+\n+ //\n+ // The path to the CLI configuration file. Default is empty.\n+ // bundleConfig = file(../rn-cli.config.js)\n+ //\n+ // The name of the generated asset file containing your JS bundle\n+ // bundleAssetName = \"MyApplication.android.bundle\"\n+ //\n+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'\n+ // entryFile = file(\"../js/MyApplication.android.js\")\n+ //\n+ // A list of extra flags to pass to the 'bundle' commands.\n+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle\n+ // extraPackagerArgs = []\n+\n+ /* Hermes Commands */\n+ // The hermes compiler command to run. By default it is 'hermesc'\n+ // hermesCommand = \"$rootDir/my-custom-hermesc/bin/hermesc\"\n+ //\n+ // The list of flags to pass to the Hermes compiler. By default is \"-O\", \"-output-source-map\"\n+ // hermesFlags = [\"-O\", \"-output-source-map\"]\n+}\n \n /**\n- * Run Proguard to shrink the Java bytecode in release builds.\n+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.\n */\n def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()\n \n /**\n- * The preferred build flavor of JavaScriptCore.\n+ * The preferred build flavor of JavaScriptCore (JSC)\n *\n * For example, to use the international variant, you can use:\n * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`\n *\n * The international variant includes ICU i18n library and necessary data\n * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that\n- * give correct results when using with locales other than en-US. Note that\n+ * give correct results when using with locales other than en-US. Note that\n * this variant is about 6MiB larger per architecture than default.\n */\n def jscFlavor = 'org.webkit:android-jsc:+'\n \n-/**\n- * Whether to enable the Hermes VM.\n- *\n- * This should be set on project.ext.react and that value will be read here. If it is not set\n- * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode\n- * and the benefits of using Hermes will therefore be sharply reduced.\n- */\n-def enableHermes = project.ext.react.get(\"enableHermes\", false);\n-\n-/**\n- * Architectures to build native code for.\n- */\n-def reactNativeArchitectures() {\n- def value = project.getProperties().get(\"reactNativeArchitectures\")\n- return value ? value.split(\",\") : [\"armeabi-v7a\", \"x86\", \"x86_64\", \"arm64-v8a\"]\n-}\n-\n android {\n ndkVersion rootProject.ext.ndkVersion\n \n compileSdkVersion rootProject.ext.compileSdkVersion\n \n+ namespace \"com.helloworld\"\n defaultConfig {\n applicationId \"com.helloworld\"\n minSdkVersion rootProject.ext.minSdkVersion\n targetSdkVersion rootProject.ext.targetSdkVersion\n versionCode 1\n versionName \"1.0\"\n- buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- arguments \"APP_PLATFORM=android-21\",\n- \"APP_STL=c++_shared\",\n- \"NDK_TOOLCHAIN_VERSION=clang\",\n- \"GENERATED_SRC_DIR=$buildDir/generated/source\",\n- \"PROJECT_BUILD_DIR=$buildDir\",\n- \"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid\",\n- \"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build\"\n- cFlags \"-Wall\", \"-Werror\", \"-fexceptions\", \"-frtti\", \"-DWITH_INSPECTOR=1\"\n- cppFlags \"-std=c++17\"\n- // Make sure this target name is the same you specify inside the\n- // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.\n- targets \"helloworld_appmodules\"\n-\n- // Fix for windows limit on number of character in file paths and in command lines\n- if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n- arguments \"NDK_APP_SHORT_COMMANDS=true\"\n- }\n- }\n- }\n- if (!enableSeparateBuildPerCPUArchitecture) {\n- ndk {\n- abiFilters (*reactNativeArchitectures())\n- }\n- }\n- }\n- }\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- path \"$projectDir/src/main/jni/Android.mk\"\n- }\n- }\n- def reactAndroidProjectDir = project(':ReactAndroid').projectDir\n- def packageReactNdkDebugLibs = tasks.register(\"packageReactNdkDebugLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkDebugLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- def packageReactNdkReleaseLibs = tasks.register(\"packageReactNdkReleaseLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkReleaseLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- afterEvaluate {\n- // If you wish to add a custom TurboModule or component locally,\n- // you should uncomment this line.\n- // preBuild.dependsOn(\"generateCodegenArtifactsFromSchema\")\n- preDebugBuild.dependsOn(packageReactNdkDebugLibs)\n- preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)\n \n- // Due to a bug inside AGP, we have to explicitly set a dependency\n- // between configureNdkBuild* tasks and the preBuild tasks.\n- // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732\n- configureNdkBuildRelease.dependsOn(preReleaseBuild)\n- configureNdkBuildDebug.dependsOn(preDebugBuild)\n- reactNativeArchitectures().each { architecture ->\n- tasks.findByName(\"configureNdkBuildDebug[${architecture}]\")?.configure {\n- dependsOn(\"preDebugBuild\")\n- }\n- tasks.findByName(\"configureNdkBuildRelease[${architecture}]\")?.configure {\n- dependsOn(\"preReleaseBuild\")\n- }\n- }\n- }\n- }\n-\n- splits {\n- abi {\n- reset()\n- enable enableSeparateBuildPerCPUArchitecture\n- universalApk false // If true, also generate a universal APK\n- include (*reactNativeArchitectures())\n- }\n+ buildConfigField(\"boolean\", \"REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS\", (findProperty(\"reactNative.unstable_useRuntimeSchedulerAlways\") ?: true).toString())\n }\n signingConfigs {\n debug {\n@@ -244,25 +107,11 @@ android {\n // Caution! In production, you need to generate your own keystore file.\n // see https://reactnative.dev/docs/signed-apk-android.\n signingConfig signingConfigs.debug\n+ shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)\n minifyEnabled enableProguardInReleaseBuilds\n proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n }\n }\n-\n- // applicationVariants are e.g. debug, release\n- applicationVariants.all { variant ->\n- variant.outputs.each { output ->\n- // For each separate APK per architecture, set a unique version code as described here:\n- // https://developer.android.com/studio/build/configure-apk-splits.html\n- def versionCodes = [\"armeabi-v7a\": 1, \"x86\": 2, \"arm64-v8a\": 3, \"x86_64\": 4]\n- def abi = output.getFilter(OutputFile.ABI)\n- if (abi != null) { // null for the universal-debug, universal-release variants\n- output.versionCodeOverride =\n- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n- }\n-\n- }\n- }\n }\n \n // Apply static values from `gradle.properties` to the `android.packagingOptions`\n@@ -286,10 +135,8 @@ android {\n }\n \n dependencies {\n- implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n-\n- //noinspection GradleDynamicVersion\n- implementation \"com.facebook.react:react-native:+\" // From node_modules\n+ // The version of react-native is set by the React Native Gradle Plugin\n+ implementation(\"com.facebook.react:react-android\")\n \n def isGifEnabled = (findProperty('expo.gif.enabled') ?: \"\") == \"true\";\n def isWebpEnabled = (findProperty('expo.webp.enabled') ?: \"\") == \"true\";\n@@ -298,70 +145,36 @@ dependencies {\n \n // If your app supports Android versions before Ice Cream Sandwich (API level 14)\n if (isGifEnabled || isWebpEnabled) {\n- implementation \"com.facebook.fresco:fresco:${frescoVersion}\"\n- implementation \"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:fresco:${frescoVersion}\")\n+ implementation(\"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\")\n }\n \n if (isGifEnabled) {\n // For animated gif support\n- implementation \"com.facebook.fresco:animated-gif:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-gif:${frescoVersion}\")\n }\n \n if (isWebpEnabled) {\n // For webp support\n- implementation \"com.facebook.fresco:webpsupport:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:webpsupport:${frescoVersion}\")\n if (isWebpAnimatedEnabled) {\n // Animated webp support\n- implementation \"com.facebook.fresco:animated-webp:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-webp:${frescoVersion}\")\n }\n }\n \n- implementation \"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\"\n- debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.fbjni'\n- }\n+ debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\")\n debugImplementation(\"com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n exclude group:'com.squareup.okhttp3', module:'okhttp'\n }\n- debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n- }\n+ debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\")\n \n- if (enableHermes) {\n- debugImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-debug.aar\"))\n- releaseImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-release.aar\"))\n+ if (hermesEnabled.toBoolean()) {\n+ implementation(\"com.facebook.react:hermes-android\")\n } else {\n implementation jscFlavor\n }\n }\n \n-if (isNewArchitectureEnabled()) {\n- // If new architecture is enabled, we let you build RN from source\n- // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.\n- // This will be applied to all the imported transtitive dependency.\n- configurations.all {\n- resolutionStrategy.dependencySubstitution {\n- substitute(module(\"com.facebook.react:react-native\"))\n- .using(project(\":ReactAndroid\")).because(\"On New Architecture we're building React Native from source\")\n- }\n- }\n-}\n-\n-// Run this once to be able to run the application with BUCK\n-// puts all compile dependencies into folder libs for BUCK to use\n-task copyDownloadableDepsToLibs(type: Copy) {\n- from configurations.implementation\n- into 'libs'\n-}\n-\n apply from: new File([\"node\", \"--print\", \"require.resolve('@react-native-community/cli-platform-android/package.json')\"].execute(null, rootDir).text.trim(), \"../native_modules.gradle\");\n applyNativeModulesAppBuildGradle(project)\n-\n-def isNewArchitectureEnabled() {\n- // To opt-in for the New Architecture, you can either:\n- // - Set `newArchEnabled` to true inside the `gradle.properties` file\n- // - Invoke gradle with `-newArchEnabled=true`\n- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`\n- return project.hasProperty(\"newArchEnabled\") && project.newArchEnabled == \"true\"\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/build_defs.bzl b/templates/expo-template-bare-minimum/android/app/build_defs.bzl\ndeleted file mode 100644\nindex fff270f8d1..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/build_defs.bzl\n+++ /dev/null\n@@ -1,19 +0,0 @@\n-\"\"\"Helper definitions to glob .aar and .jar targets\"\"\"\n-\n-def create_aar_targets(aarfiles):\n- for aarfile in aarfiles:\n- name = \"aars__\" + aarfile[aarfile.rindex(\"/\") + 1:aarfile.rindex(\".aar\")]\n- lib_deps.append(\":\" + name)\n- android_prebuilt_aar(\n- name = name,\n- aar = aarfile,\n- )\n-\n-def create_jar_targets(jarfiles):\n- for jarfile in jarfiles:\n- name = \"jars__\" + jarfile[jarfile.rindex(\"/\") + 1:jarfile.rindex(\".jar\")]\n- lib_deps.append(\":\" + name)\n- prebuilt_jar(\n- name = name,\n- binary_jar = jarfile,\n- )\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/debug/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/debug/AndroidManifest.xml\nindex 99e38fc5f8..3ec2507bab 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/debug/AndroidManifest.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/debug/AndroidManifest.xml\n@@ -3,5 +3,5 @@\n \n \n \n- \n+ \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\nindex 8cddb11cb2..595dd5831c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n@@ -1,5 +1,5 @@\n /**\n- * Copyright (c) Facebook, Inc. and its affiliates.\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *

This source code is licensed under the MIT license found in the LICENSE file in the root\n * directory of this source tree.\n@@ -17,22 +17,27 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping;\n import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;\n import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;\n import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;\n-import com.facebook.flipper.plugins.react.ReactFlipperPlugin;\n import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;\n+import com.facebook.react.ReactInstanceEventListener;\n import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.bridge.ReactContext;\n import com.facebook.react.modules.network.NetworkingModule;\n import okhttp3.OkHttpClient;\n \n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the debug\n+ * flavor of it. Here you can add your own plugins and customize the Flipper setup.\n+ */\n public class ReactNativeFlipper {\n public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n if (FlipperUtils.shouldEnableFlipper(context)) {\n final FlipperClient client = AndroidFlipperClient.getInstance(context);\n+\n client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));\n- client.addPlugin(new ReactFlipperPlugin());\n client.addPlugin(new DatabasesFlipperPlugin(context));\n client.addPlugin(new SharedPreferencesFlipperPlugin(context));\n client.addPlugin(CrashReporterPlugin.getInstance());\n+\n NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();\n NetworkingModule.setCustomClientBuilder(\n new NetworkingModule.CustomClientBuilder() {\n@@ -43,12 +48,13 @@ public class ReactNativeFlipper {\n });\n client.addPlugin(networkFlipperPlugin);\n client.start();\n+\n // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized\n // Hence we run if after all native modules have been initialized\n ReactContext reactContext = reactInstanceManager.getCurrentReactContext();\n if (reactContext == null) {\n reactInstanceManager.addReactInstanceEventListener(\n- new ReactInstanceManager.ReactInstanceEventListener() {\n+ new ReactInstanceEventListener() {\n @Override\n public void onReactContextInitialized(ReactContext reactContext) {\n reactInstanceManager.removeReactInstanceEventListener(this);\n@@ -66,4 +72,4 @@ public class ReactNativeFlipper {\n }\n }\n }\n-}\n\\ No newline at end of file\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\nindex 0cad655b33..34a7ca8314 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n@@ -1,4 +1,4 @@\n-\n+\n \n \n \n@@ -18,7 +18,7 @@\n \n \n \n- \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 576e23db45..176fbf6a2a 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -28,11 +29,18 @@ public class MainActivity extends ReactActivity {\n return \"main\";\n }\n \n+ /**\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n+ */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled()));\n }\n \n /**\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..e7f376902d 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,76 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \".expo/.virtual-metro-entry\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false;\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ }\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +79,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex f555e36448..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,116 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- new EmptyReactNativeConfig(),\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex 0ae6366756..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,49 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,7 +18,7 @@\n \n \n \n- \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 8e13797d9b..176fbf6a2a 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -29,15 +30,17 @@ public class MainActivity extends ReactActivity {\n }\n \n /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled()));\n }\n \n /**\n@@ -59,25 +62,4 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..e7f376902d 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,76 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \".expo/.virtual-metro-entry\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false;\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ }\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +79,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex cda1391225..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source\n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_runtime \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,7 +18,7 @@\n \n \n \n- \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 8e13797d9b..176fbf6a2a 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -29,15 +30,17 @@ public class MainActivity extends ReactActivity {\n }\n \n /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled()));\n }\n \n /**\n@@ -59,25 +62,4 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..e7f376902d 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,76 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \".expo/.virtual-metro-entry\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false;\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ }\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +79,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\ndeleted file mode 100644\nindex d2cad3a326..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-cmake_minimum_required(VERSION 3.13)\n-\n-# Define the library name here.\n-project(helloworld_appmodules)\n-\n-# This file includes all the necessary to let you build your application with the New Architecture.\n-include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 26162dd872..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n-\n- // Module providers autolinked by RN CLI\n- auto rncli_module = rncli_ModuleProvider(moduleName, params);\n- if (rncli_module != nullptr) {\n- return rncli_module;\n- }\n-\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex b38ccf53fd..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex 5fd688c509..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- const std::string &name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 9ee38a81f6..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(const std::string &name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 54f598a486..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,65 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Autolinked providers registered by RN CLI\n- rncli_registerProviders(providerRegistry);\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n \n- \n+ \n \n \n \n@@ -29,4 +29,4 @@\n \n \n \n-\n+\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 576e23db45..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,57 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..8258c40ed4\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,65 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.config.ReactFeatureFlags\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.react.flipper.ReactNativeFlipper\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex f555e36448..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,116 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- new EmptyReactNativeConfig(),\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex 0ae6366756..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,49 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n \n- \n+ \n \n \n \n@@ -29,4 +29,4 @@\n \n \n \n-\n+\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 8e13797d9b..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n- */\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..8258c40ed4\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,65 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.config.ReactFeatureFlags\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.react.flipper.ReactNativeFlipper\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex cda1391225..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source\n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_runtime \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n \n- \n+ \n \n \n \n@@ -29,4 +29,4 @@\n \n \n \n-\n+\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 8e13797d9b..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n- */\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..8258c40ed4\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,65 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.config.ReactFeatureFlags\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.react.flipper.ReactNativeFlipper\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\ndeleted file mode 100644\nindex d2cad3a326..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-cmake_minimum_required(VERSION 3.13)\n-\n-# Define the library name here.\n-project(helloworld_appmodules)\n-\n-# This file includes all the necessary to let you build your application with the New Architecture.\n-include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 26162dd872..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n-\n- // Module providers autolinked by RN CLI\n- auto rncli_module = rncli_ModuleProvider(moduleName, params);\n- if (rncli_module != nullptr) {\n- return rncli_module;\n- }\n-\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex b38ccf53fd..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex 5fd688c509..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- const std::string &name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 9ee38a81f6..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(const std::string &name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 54f598a486..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,65 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Autolinked providers registered by RN CLI\n- rncli_registerProviders(providerRegistry);\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n- \n- \n+ \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 576e23db45..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,57 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..95ef45de96\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,57 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex f555e36448..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,116 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- new EmptyReactNativeConfig(),\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex 0ae6366756..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,49 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n- \n- \n+ \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 8e13797d9b..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n- */\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..95ef45de96\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,57 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex cda1391225..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source\n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_runtime \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n- \n- \n+ \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 8e13797d9b..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n- */\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..95ef45de96\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,57 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\ndeleted file mode 100644\nindex d2cad3a326..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-cmake_minimum_required(VERSION 3.13)\n-\n-# Define the library name here.\n-project(helloworld_appmodules)\n-\n-# This file includes all the necessary to let you build your application with the New Architecture.\n-include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 26162dd872..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n-\n- // Module providers autolinked by RN CLI\n- auto rncli_module = rncli_ModuleProvider(moduleName, params);\n- if (rncli_module != nullptr) {\n- return rncli_module;\n- }\n-\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex b38ccf53fd..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex 5fd688c509..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- const std::string &name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 9ee38a81f6..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(const std::string &name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 54f598a486..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,65 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Autolinked providers registered by RN CLI\n- rncli_registerProviders(providerRegistry);\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 576e23db45..7e2823fb6c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -28,11 +29,21 @@ public class MainActivity extends ReactActivity {\n return \"main\";\n }\n \n+ /**\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n+ */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled\n+ // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).\n+ DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled\n+ ));\n }\n \n /**\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..31c2b288c1 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,70 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \"index\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +73,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex f555e36448..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,116 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- new EmptyReactNativeConfig(),\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex 0ae6366756..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,49 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\nnew file mode 100644\nindex 0000000000..b510364404\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\n@@ -0,0 +1,20 @@\n+/**\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n+ *\n+ *

This source code is licensed under the MIT license found in the LICENSE file in the root\n+ * directory of this source tree.\n+ */\n+package com.helloworld;\n+\n+import android.content.Context;\n+import com.facebook.react.ReactInstanceManager;\n+\n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the release\n+ * flavor of it so it's empty as we don't want to load Flipper.\n+ */\n+public class ReactNativeFlipper {\n+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n+ // Do nothing as we don't want to initialize Flipper on Release.\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/build.gradle b/templates/expo-template-bare-minimum/android/build.gradle\nindex fa77528908..e5fda82878 100644\n--- a/templates/expo-template-bare-minimum/android/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/build.gradle\n@@ -1,50 +1,31 @@\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n // Top-level build file where you can add configuration options common to all sub-projects/modules.\n \n buildscript {\n ext {\n- buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'\n+ buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0'\n minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')\n- compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')\n- targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')\n+ compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33')\n+ targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33')\n if (findProperty('android.kotlinVersion')) {\n kotlinVersion = findProperty('android.kotlinVersion')\n }\n frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'\n \n- if (System.properties['os.arch'] == 'aarch64') {\n- // For M1 Users we need to use the NDK 24 which added support for aarch64\n- ndkVersion = '24.0.8215888'\n- } else {\n- // Otherwise we default to the side-by-side NDK version from AGP.\n- ndkVersion = '21.4.7075529'\n- }\n+ // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.\n+ ndkVersion = \"23.1.7779620\"\n }\n repositories {\n google()\n mavenCentral()\n }\n dependencies {\n- classpath('com.android.tools.build:gradle:7.0.4')\n+ classpath('com.android.tools.build:gradle:7.4.1')\n classpath('com.facebook.react:react-native-gradle-plugin')\n- classpath('de.undercouch:gradle-download-task:4.1.2')\n- // NOTE: Do not place your application dependencies here; they belong\n- // in the individual module build.gradle files\n }\n }\n \n-def REACT_NATIVE_VERSION = new File(['node', '--print',\"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n-\n allprojects {\n- configurations.all {\n- resolutionStrategy {\n- force \"com.facebook.react:react-native:\" + REACT_NATIVE_VERSION\n- }\n- }\n-\n repositories {\n- mavenLocal()\n maven {\n // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm\n url(new File(['node', '--print', \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), '../android'))\n@@ -55,13 +36,7 @@ allprojects {\n }\n \n google()\n- mavenCentral {\n- // We don't want to fetch react-native from Maven Central as there are\n- // older versions over there.\n- content {\n- excludeGroup 'com.facebook.react'\n- }\n- }\n+ mavenCentral()\n maven { url 'https://www.jitpack.io' }\n }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/gitignore b/templates/expo-template-bare-minimum/android/gitignore\nindex 64436baaf5..877b87e9a5 100644\n--- a/templates/expo-template-bare-minimum/android/gitignore\n+++ b/templates/expo-template-bare-minimum/android/gitignore\n@@ -11,11 +11,5 @@ local.properties\n *.iml\n *.hprof\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/android/gradle.properties b/templates/expo-template-bare-minimum/android/gradle.properties\nindex fab3fb6bcf..9911ac4afd 100644\n--- a/templates/expo-template-bare-minimum/android/gradle.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle.properties\n@@ -42,7 +42,7 @@ newArchEnabled=false\n \n # The hosted JavaScript engine\n # Supported values: expo.jsEngine = \"hermes\" | \"jsc\"\n-expo.jsEngine=jsc\n+expo.jsEngine=hermes\n \n # Enable GIF support in React Native images (~200 B increase)\n expo.gif.enabled=true\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar\nindex 7454180f2a..249e5832f0 100644\nBinary files a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar and b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar differ\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\nindex 669386b870..8fad3f5a98 100644\n--- a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n@@ -1,5 +1,5 @@\n distributionBase=GRADLE_USER_HOME\n distributionPath=wrapper/dists\n-distributionUrl=https\\://services.gradle.org/distributions/gradle-7.3.3-all.zip\n+distributionUrl=https\\://services.gradle.org/distributions/gradle-7.5.1-all.zip\n zipStoreBase=GRADLE_USER_HOME\n zipStorePath=wrapper/dists\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew b/templates/expo-template-bare-minimum/android/gradlew\nindex 1b6c787337..a69d9cb6c2 100755\n--- a/templates/expo-template-bare-minimum/android/gradlew\n+++ b/templates/expo-template-bare-minimum/android/gradlew\n@@ -205,6 +205,12 @@ set -- \\\n org.gradle.wrapper.GradleWrapperMain \\\n \"$@\"\n \n+# Stop when \"xargs\" is not available.\n+if ! command -v xargs >/dev/null 2>&1\n+then\n+ die \"xargs is not available\"\n+fi\n+\n # Use \"xargs\" to parse quoted args.\n #\n # With -n1 it outputs one arg per line, with the quotes and backslashes removed.\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew.bat b/templates/expo-template-bare-minimum/android/gradlew.bat\nindex ac1b06f938..53a6b238d4 100644\n--- a/templates/expo-template-bare-minimum/android/gradlew.bat\n+++ b/templates/expo-template-bare-minimum/android/gradlew.bat\n@@ -14,7 +14,7 @@\n @rem limitations under the License.\r\n @rem\r\n \r\n-@if \"%DEBUG%\" == \"\" @echo off\r\n+@if \"%DEBUG%\"==\"\" @echo off\r\n @rem ##########################################################################\r\n @rem\r\n @rem Gradle startup script for Windows\r\n@@ -25,7 +25,7 @@\n if \"%OS%\"==\"Windows_NT\" setlocal\r\n \r\n set DIRNAME=%~dp0\r\n-if \"%DIRNAME%\" == \"\" set DIRNAME=.\r\n+if \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n set APP_BASE_NAME=%~n0\r\n set APP_HOME=%DIRNAME%\r\n \r\n@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome\n \r\n set JAVA_EXE=java.exe\r\n %JAVA_EXE% -version >NUL 2>&1\r\n-if \"%ERRORLEVEL%\" == \"0\" goto execute\r\n+if %ERRORLEVEL% equ 0 goto execute\r\n \r\n echo.\r\n echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\n@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n \r\n :end\r\n @rem End local scope for the variables with windows NT shell\r\n-if \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n+if %ERRORLEVEL% equ 0 goto mainEnd\r\n \r\n :fail\r\n rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\n rem the _cmd.exe /c_ return code!\r\n-if not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\n-exit /b 1\r\n+set EXIT_CODE=%ERRORLEVEL%\r\n+if %EXIT_CODE% equ 0 set EXIT_CODE=1\r\n+if not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\n+exit /b %EXIT_CODE%\r\n \r\n :mainEnd\r\n if \"%OS%\"==\"Windows_NT\" endlocal\r\ndiff --git a/templates/expo-template-bare-minimum/android/settings.gradle b/templates/expo-template-bare-minimum/android/settings.gradle\nindex fa543f0c69..1dc416e7c1 100644\n--- a/templates/expo-template-bare-minimum/android/settings.gradle\n+++ b/templates/expo-template-bare-minimum/android/settings.gradle\n@@ -8,8 +8,3 @@ applyNativeModulesSettingsGradle(settings)\n \n include ':app'\n includeBuild(new File([\"node\", \"--print\", \"require.resolve('react-native-gradle-plugin/package.json')\"].execute(null, rootDir).text.trim()).getParentFile())\n-\n-if (settings.hasProperty(\"newArchEnabled\") && settings.newArchEnabled == \"true\") {\n- include(\":ReactAndroid\")\n- project(\":ReactAndroid\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid\");\n-}\ndiff --git a/templates/expo-template-bare-minimum/gitignore b/templates/expo-template-bare-minimum/gitignore\nindex c8eb0f9a64..df57ba88a1 100644\n--- a/templates/expo-template-bare-minimum/gitignore\n+++ b/templates/expo-template-bare-minimum/gitignore\n@@ -30,6 +30,9 @@ build/\n local.properties\n *.iml\n *.hprof\n+.cxx/\n+*.keystore\n+!debug.keystore\n \n # node.js\n #\n@@ -37,18 +40,15 @@ node_modules/\n npm-debug.log\n yarn-error.log\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\n \n # CocoaPods\n /ios/Pods/\n \n+# Temporary files created by Metro to check the health of the file watcher\n+.metro-health-check*\n+\n # Expo\n .expo/\n web-build/\ndiff --git a/templates/expo-template-bare-minimum/ios/.xcode.env b/templates/expo-template-bare-minimum/ios/.xcode.env\nnew file mode 100644\nindex 0000000000..3d5782c715\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/ios/.xcode.env\n@@ -0,0 +1,11 @@\n+# This `.xcode.env` file is versioned and is used to source the environment\n+# used when running script phases inside Xcode.\n+# To customize your local environment, you can create an `.xcode.env.local`\n+# file that is not versioned.\n+\n+# NODE_BINARY variable contains the PATH to the node executable.\n+#\n+# Customize the NODE_BINARY variable here.\n+# For example, to use nvm with brew, add the following line\n+# . \"$(brew --prefix nvm)/nvm.sh\" --no-use\n+export NODE_BINARY=$(command -v node)\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\nindex 2ac180e425..98e6c2afea 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n@@ -214,7 +214,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"export NODE_BINARY=node\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\n`node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\nif [[ -z \\\"$ENTRY_FILE\\\" ]]; then\\n # Set the entry JS file using the bundler's entry resolution.\\n export ENTRY_FILE=\\\"$(\\\"$NODE_BINARY\\\" -e \\\"require('expo/scripts/resolveAppEntry')\\\" $PROJECT_ROOT ios relative | tail -n 1)\\\"\\nfi\\n\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n \t\t};\n \t\t08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {\n \t\t\tisa = PBXShellScriptBuildPhase;\n@@ -276,7 +276,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"export RCT_METRO_PORT=\\\"${RCT_METRO_PORT:=8081}\\\"\\necho \\\"export RCT_METRO_PORT=${RCT_METRO_PORT}\\\" > `node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\\\"`\\nif [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\\n if ! curl -s \\\"http://localhost:${RCT_METRO_PORT}/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n echo \\\"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\\\"\\n exit 2\\n fi\\n else\\n open `node --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\\\"` || echo \\\"Can't start packager automatically\\\"\\n fi\\nfi\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\nexport RCT_METRO_PORT=\\\"${RCT_METRO_PORT:=8081}\\\"\\necho \\\"export RCT_METRO_PORT=${RCT_METRO_PORT}\\\" > `$NODE_BINARY --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\\\"`\\nif [ -z \\\"${RCT_NO_LAUNCH_PACKAGER+xxx}\\\" ] ; then\\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\\n if ! curl -s \\\"http://localhost:${RCT_METRO_PORT}/status\\\" | grep -q \\\"packager-status:running\\\" ; then\\n echo \\\"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\\\"\\n exit 2\\n fi\\n else\\n open `$NODE_BINARY --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/launchPackager.command'\\\"` || echo \\\"Can't start packager automatically\\\"\\n fi\\nfi\\n\";\n \t\t\tshowEnvVarsInLog = 0;\n \t\t};\n /* End PBXShellScriptBuildPhase section */\n@@ -308,8 +308,9 @@\n \t\t\t\t\t\"FB_SONARKIT_ENABLED=1\",\n \t\t\t\t);\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -331,8 +332,9 @@\n \t\t\t\tCLANG_ENABLE_MODULES = YES;\n \t\t\t\tCURRENT_PROJECT_VERSION = 1;\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -392,7 +394,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n@@ -441,7 +443,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\nindex f7d2972042..1658a437eb 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n@@ -1,9 +1,7 @@\n-#import \n-#import \n+#import \n #import \n-\n #import \n \n-@interface AppDelegate : EXAppDelegateWrapper \n+@interface AppDelegate : EXAppDelegateWrapper\n \n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\nindex aef81ec589..8cb5aef137 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n@@ -1,66 +1,19 @@\n #import \"AppDelegate.h\"\n \n-#import \n #import \n-#import \n #import \n-#import \n-\n-#import \n-\n-#if RCT_NEW_ARCH_ENABLED\n-#import \n-#import \n-#import \n-#import \n-#import \n-#import \n-\n-#import \n-\n-@interface AppDelegate () {\n- RCTTurboModuleManager *_turboModuleManager;\n- RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;\n- std::shared_ptr _reactNativeConfig;\n- facebook::react::ContextContainer::Shared _contextContainer;\n-}\n-@end\n-#endif\n \n @implementation AppDelegate\n \n - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n {\n- RCTAppSetupPrepareApp(application);\n-\n- RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];\n-\n-#if RCT_NEW_ARCH_ENABLED\n- _contextContainer = std::make_shared();\n- _reactNativeConfig = std::make_shared();\n- _contextContainer->insert(\"ReactNativeConfig\", _reactNativeConfig);\n- _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];\n- bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;\n-#endif\n+ self.moduleName = @\"main\";\n \n- UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:nil];\n+ // You can add your custom initial props in the dictionary below.\n+ // They will be passed down to the ViewController used by React Native.\n+ self.initialProps = @{};\n \n- rootView.backgroundColor = [UIColor whiteColor];\n- self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n- UIViewController *rootViewController = [self.reactDelegate createRootViewController];\n- rootViewController.view = rootView;\n- self.window.rootViewController = rootViewController;\n- [self.window makeKeyAndVisible];\n-\n- [super application:application didFinishLaunchingWithOptions:launchOptions];\n-\n- return YES;\n-}\n-\n-- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge\n-{\n- // If you'd like to export some custom RCTBridgeModules, add them here!\n- return @[];\n+ return [super application:application didFinishLaunchingWithOptions:launchOptions];\n }\n \n - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n@@ -72,6 +25,16 @@\n #endif\n }\n \n+/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.\n+///\n+/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html\n+/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).\n+/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.\n+- (BOOL)concurrentRootEnabled\n+{\n+ return true;\n+}\n+\n // Linking API\n - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options {\n return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];\n@@ -101,43 +64,4 @@\n return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];\n }\n \n-#if RCT_NEW_ARCH_ENABLED\n-\n-#pragma mark - RCTCxxBridgeDelegate\n-\n-- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge\n-{\n- _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge\n- delegate:self\n- jsInvoker:bridge.jsCallInvoker];\n- return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);\n-}\n-\n-#pragma mark RCTTurboModuleManagerDelegate\n-\n-- (Class)getModuleClassFromName:(const char *)name\n-{\n- return RCTCoreModulesClassProvider(name);\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- jsInvoker:(std::shared_ptr)jsInvoker\n-{\n- return nullptr;\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- initParams:\n- (const facebook::react::ObjCTurboModule::InitParams &)params\n-{\n- return nullptr;\n-}\n-\n-- (id)getModuleInstanceFromClass:(Class)moduleClass\n-{\n- return RCTAppSetupDefaultModuleFromClass(moduleClass);\n-}\n-\n-#endif\n-\n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile b/templates/expo-template-bare-minimum/ios/Podfile\nindex 29797efaaa..e523ea5cac 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile\n+++ b/templates/expo-template-bare-minimum/ios/Podfile\n@@ -5,37 +5,79 @@ require File.join(File.dirname(`node --print \"require.resolve('@react-native-com\n require 'json'\n podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}\n \n-platform :ios, podfile_properties['ios.deploymentTarget'] || '12.0'\n+ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'\n+ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = '1' if podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == 'true'\n+\n+platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'\n install! 'cocoapods',\n :deterministic_uuids => false\n \n+prepare_react_native_project!\n+\n+# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.\n+# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,\n+# you can also exclude `react-native-flipper` in `react-native.config.js`\n+#\n+# ```js\n+# module.exports = {\n+# dependencies: {\n+# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),\n+# }\n+# }\n+# ```\n+flipper_config = FlipperConfiguration.disabled\n+if ENV['NO_FLIPPER'] == '1' then\n+ # Explicitly disabled through environment variables\n+ flipper_config = FlipperConfiguration.disabled\n+elsif podfile_properties.key?('ios.flipper') then\n+ # Configure Flipper in Podfile.properties.json\n+ if podfile_properties['ios.flipper'] == 'true' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"])\n+ elsif podfile_properties['ios.flipper'] != 'false' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"], { 'Flipper' => podfile_properties['ios.flipper'] })\n+ end\n+end\n+\n target 'HelloWorld' do\n use_expo_modules!\n config = use_native_modules!\n \n use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']\n+ use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']\n \n # Flags change depending on the env values.\n flags = get_default_flags()\n \n use_react_native!(\n :path => config[:reactNativePath],\n- :hermes_enabled => flags[:hermes_enabled] || podfile_properties['expo.jsEngine'] == 'hermes',\n+ :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',\n :fabric_enabled => flags[:fabric_enabled],\n # An absolute path to your application root.\n- :app_path => \"#{Dir.pwd}/..\"\n+ :app_path => \"#{Pod::Config.instance.installation_root}/..\",\n+ # Note that if you have use_frameworks! enabled, Flipper will not work if enabled\n+ :flipper_configuration => flipper_config\n )\n \n- # Uncomment to opt-in to using Flipper\n- # Note that if you have use_frameworks! enabled, Flipper will not work\n- #\n- # if !ENV['CI']\n- # use_flipper!()\n- # end\n-\n post_install do |installer|\n- react_native_post_install(installer)\n+ react_native_post_install(\n+ installer,\n+ config[:reactNativePath],\n+ # Set `mac_catalyst_enabled` to `true` in order to apply patches\n+ # necessary for Mac Catalyst builds\n+ :mac_catalyst_enabled => false\n+ )\n __apply_Xcode_12_5_M1_post_install_workaround(installer)\n+\n+ # This is necessary for Xcode 14, because it signs resource bundles by default\n+ # when building for devices.\n+ installer.target_installation_results.pod_target_installation_results\n+ .each do |pod_name, target_installation_result|\n+ target_installation_result.resource_bundle_targets.each do |resource_bundle_target|\n+ resource_bundle_target.build_configurations.each do |config|\n+ config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'\n+ end\n+ end\n+ end\n end\n \n post_integrate do |installer|\n@@ -45,5 +87,4 @@ target 'HelloWorld' do\n Pod::UI.warn e\n end\n end\n-\n end\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile.properties.json b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\nindex f6d872e81a..b1bd45da51 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n+++ b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n@@ -1,3 +1,3 @@\n {\n- \"expo.jsEngine\": \"jsc\"\n+ \"expo.jsEngine\": \"hermes\"\n }\ndiff --git a/templates/expo-template-bare-minimum/ios/gitignore b/templates/expo-template-bare-minimum/ios/gitignore\nindex 2b13519939..8beb344303 100644\n--- a/templates/expo-template-bare-minimum/ios/gitignore\n+++ b/templates/expo-template-bare-minimum/ios/gitignore\n@@ -21,6 +21,7 @@ DerivedData\n *.ipa\n *.xcuserstate\n project.xcworkspace\n+.xcode.env.local\n \n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json\nindex 69e7eb9619..d1fcd513cc 100644\n--- a/templates/expo-template-bare-minimum/package.json\n+++ b/templates/expo-template-bare-minimum/package.json\n@@ -1,7 +1,7 @@\n {\n \"name\": \"expo-template-bare-minimum\",\n \"description\": \"This bare project template includes a minimal setup for using unimodules with React Native.\",\n- \"version\": \"45.0.6\",\n+ \"version\": \"48.0.21\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"expo start --dev-client\",\n@@ -10,15 +10,13 @@\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n- \"expo\": \"~45.0.0\",\n- \"expo-splash-screen\": \"~0.15.1\",\n- \"expo-status-bar\": \"~1.3.0\",\n- \"react\": \"17.0.2\",\n- \"react-dom\": \"17.0.2\",\n- \"react-native\": \"0.68.2\",\n- \"react-native-web\": \"0.17.7\"\n+ \"expo\": \"~48.0.21\",\n+ \"expo-splash-screen\": \"~0.18.2\",\n+ \"expo-status-bar\": \"~1.4.4\",\n+ \"react\": \"18.2.0\",\n+ \"react-native\": \"0.71.14\"\n },\n \"devDependencies\": {\n- \"@babel/core\": \"^7.12.9\"\n+ \"@babel/core\": \"^7.20.0\"\n }\n }\n","46..48":"diff --git a/templates/expo-template-bare-minimum/.buckconfig b/templates/expo-template-bare-minimum/.buckconfig\ndeleted file mode 100644\nindex 934256cb29..0000000000\n--- a/templates/expo-template-bare-minimum/.buckconfig\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-\n-[android]\n- target = Google Inc.:Google APIs:23\n-\n-[maven_repositories]\n- central = https://repo1.maven.org/maven2\ndiff --git a/templates/expo-template-bare-minimum/.npmignore b/templates/expo-template-bare-minimum/.npmignore\nindex 35490b6612..4e6ce00391 100644\n--- a/templates/expo-template-bare-minimum/.npmignore\n+++ b/templates/expo-template-bare-minimum/.npmignore\n@@ -20,3 +20,4 @@ ios/Pods\n android/.build\n android/app/build\n android/.gradle\n+ios/.xcode.env.local\ndiff --git a/templates/expo-template-bare-minimum/android/app/BUCK b/templates/expo-template-bare-minimum/android/app/BUCK\ndeleted file mode 100644\nindex 0e77904834..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/BUCK\n+++ /dev/null\n@@ -1,55 +0,0 @@\n-# To learn about Buck see [Docs](https://buckbuild.com/).\n-# To run your application with Buck:\n-# - install Buck\n-# - `npm start` - to start the packager\n-# - `cd android`\n-# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\"`\n-# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck\n-# - `buck install -r android/app` - compile, install and run application\n-#\n-\n-load(\":build_defs.bzl\", \"create_aar_targets\", \"create_jar_targets\")\n-\n-lib_deps = []\n-\n-create_aar_targets(glob([\"libs/*.aar\"]))\n-\n-create_jar_targets(glob([\"libs/*.jar\"]))\n-\n-android_library(\n- name = \"all-libs\",\n- exported_deps = lib_deps,\n-)\n-\n-android_library(\n- name = \"app-code\",\n- srcs = glob([\n- \"src/main/java/**/*.java\",\n- ]),\n- deps = [\n- \":all-libs\",\n- \":build_config\",\n- \":res\",\n- ],\n-)\n-\n-android_build_config(\n- name = \"build_config\",\n- package = \"com.helloworld\",\n-)\n-\n-android_resource(\n- name = \"res\",\n- package = \"com.helloworld\",\n- res = \"src/main/res\",\n-)\n-\n-android_binary(\n- name = \"app\",\n- keystore = \"//android/keystores:debug\",\n- manifest = \"src/main/AndroidManifest.xml\",\n- package_type = \"debug\",\n- deps = [\n- \":app-code\",\n- ],\n-)\ndiff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex f0293fe400..189390e7e3 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -1,136 +1,107 @@\n apply plugin: \"com.android.application\"\n+apply plugin: \"com.facebook.react\"\n \n import com.android.build.OutputFile\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n-/**\n- * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n- * and bundleReleaseJsAndAssets).\n- * These basically call `react-native bundle` with the correct arguments during the Android build\n- * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the\n- * bundle directly from the development server. Below you can see all the possible configurations\n- * and their defaults. If you decide to add a configuration block, make sure to add it before the\n- * `apply from: \"../../node_modules/react-native/react.gradle\"` line.\n- *\n- * project.ext.react = [\n- * // the name of the generated asset file containing your JS bundle\n- * bundleAssetName: \"index.android.bundle\",\n- *\n- * // the entry file for bundle generation. If none specified and\n- * // \"index.android.js\" exists, it will be used. Otherwise \"index.js\" is\n- * // default. Can be overridden with ENTRY_FILE environment variable.\n- * entryFile: \"index.android.js\",\n- *\n- * // https://reactnative.dev/docs/performance#enable-the-ram-format\n- * bundleCommand: \"ram-bundle\",\n- *\n- * // whether to bundle JS and assets in debug mode\n- * bundleInDebug: false,\n- *\n- * // whether to bundle JS and assets in release mode\n- * bundleInRelease: true,\n- *\n- * // whether to bundle JS and assets in another build variant (if configured).\n- * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants\n- * // The configuration property can be in the following formats\n- * // 'bundleIn${productFlavor}${buildType}'\n- * // 'bundleIn${buildType}'\n- * // bundleInFreeDebug: true,\n- * // bundleInPaidRelease: true,\n- * // bundleInBeta: true,\n- *\n- * // whether to disable dev mode in custom build variants (by default only disabled in release)\n- * // for example: to disable dev mode in the staging build type (if configured)\n- * devDisabledInStaging: true,\n- * // The configuration property can be in the following formats\n- * // 'devDisabledIn${productFlavor}${buildType}'\n- * // 'devDisabledIn${buildType}'\n- *\n- * // the root of your project, i.e. where \"package.json\" lives\n- * root: \"../../\",\n- *\n- * // where to put the JS bundle asset in debug mode\n- * jsBundleDirDebug: \"$buildDir/intermediates/assets/debug\",\n- *\n- * // where to put the JS bundle asset in release mode\n- * jsBundleDirRelease: \"$buildDir/intermediates/assets/release\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in debug mode\n- * resourcesDirDebug: \"$buildDir/intermediates/res/merged/debug\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in release mode\n- * resourcesDirRelease: \"$buildDir/intermediates/res/merged/release\",\n- *\n- * // by default the gradle tasks are skipped if none of the JS files or assets change; this means\n- * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to\n- * // date; if you have any other folders that you want to ignore for performance reasons (gradle\n- * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/\n- * // for example, you might want to remove it from here.\n- * inputExcludes: [\"android/**\", \"ios/**\"],\n- *\n- * // override which node gets called and with what additional arguments\n- * nodeExecutableAndArgs: [\"node\"],\n- *\n- * // supply additional arguments to the packager\n- * extraPackagerArgs: []\n- * ]\n- */\n \n def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()\n+def expoDebuggableVariants = ['debug']\n+// Override `debuggableVariants` for expo-updates debugging\n+if (System.getenv('EX_UPDATES_NATIVE_DEBUG') == \"1\") {\n+ react {\n+ expoDebuggableVariants = []\n+ }\n+}\n \n-def reactNativeRoot = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath()\n \n-project.ext.react = [\n- entryFile: [\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\"].execute(null, rootDir).text.trim(),\n- enableHermes: (findProperty('expo.jsEngine') ?: \"jsc\") == \"hermes\",\n- hermesCommand: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\",\n- cliPath: \"${reactNativeRoot}/cli.js\",\n- composeSourceMapsPath: \"${reactNativeRoot}/scripts/compose-source-maps.js\",\n-]\n+/**\n+ * This is the configuration block to customize your React Native Android app.\n+ * By default you don't need to apply any configuration, just uncomment the lines you need.\n+ */\n+react {\n+ entryFile = file([\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\", \"absolute\"].execute(null, rootDir).text.trim())\n+ reactNativeDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()\n+ hermesCommand = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\"\n+ debuggableVariants = expoDebuggableVariants\n+\n+ /* Folders */\n+ // The root of your project, i.e. where \"package.json\" lives. Default is '..'\n+ // root = file(\"../\")\n+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native\n+ // reactNativeDir = file(\"../node_modules/react-native\")\n+ // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen\n+ // codegenDir = file(\"../node_modules/react-native-codegen\")\n+ // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js\n+ // cliFile = file(\"../node_modules/react-native/cli.js\")\n+\n+ /* Variants */\n+ // The list of variants to that are debuggable. For those we're going to\n+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.\n+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.\n+ // debuggableVariants = [\"liteDebug\", \"prodDebug\"]\n+\n+ /* Bundling */\n+ // A list containing the node command and its flags. Default is just 'node'.\n+ // nodeExecutableAndArgs = [\"node\"]\n+ //\n+ // The command to run when bundling. By default is 'bundle'\n+ // bundleCommand = \"ram-bundle\"\n+ //\n+ // The path to the CLI configuration file. Default is empty.\n+ // bundleConfig = file(../rn-cli.config.js)\n+ //\n+ // The name of the generated asset file containing your JS bundle\n+ // bundleAssetName = \"MyApplication.android.bundle\"\n+ //\n+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'\n+ // entryFile = file(\"../js/MyApplication.android.js\")\n+ //\n+ // A list of extra flags to pass to the 'bundle' commands.\n+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle\n+ // extraPackagerArgs = []\n+\n+ /* Hermes Commands */\n+ // The hermes compiler command to run. By default it is 'hermesc'\n+ // hermesCommand = \"$rootDir/my-custom-hermesc/bin/hermesc\"\n+ //\n+ // The list of flags to pass to the Hermes compiler. By default is \"-O\", \"-output-source-map\"\n+ // hermesFlags = [\"-O\", \"-output-source-map\"]\n+}\n \n-apply from: new File(reactNativeRoot, \"react.gradle\")\n+// Override `hermesEnabled` by `expo.jsEngine`\n+ext {\n+ hermesEnabled = (findProperty('expo.jsEngine') ?: \"hermes\") == \"hermes\"\n+}\n \n /**\n- * Set this to true to create two separate APKs instead of one:\n- * - An APK that only works on ARM devices\n- * - An APK that only works on x86 devices\n- * The advantage is the size of the APK is reduced by about 4MB.\n- * Upload all the APKs to the Play Store and people will download\n- * the correct one based on the CPU architecture of their device.\n+ * Set this to true to create four separate APKs instead of one,\n+ * one for each native architecture. This is useful if you don't\n+ * use App Bundles (https://developer.android.com/guide/app-bundle/)\n+ * and want to have separate APKs to upload to the Play Store.\n */\n def enableSeparateBuildPerCPUArchitecture = false\n \n /**\n- * Run Proguard to shrink the Java bytecode in release builds.\n+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.\n */\n def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()\n \n /**\n- * The preferred build flavor of JavaScriptCore.\n+ * The preferred build flavor of JavaScriptCore (JSC)\n *\n * For example, to use the international variant, you can use:\n * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`\n *\n * The international variant includes ICU i18n library and necessary data\n * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that\n- * give correct results when using with locales other than en-US. Note that\n+ * give correct results when using with locales other than en-US. Note that\n * this variant is about 6MiB larger per architecture than default.\n */\n def jscFlavor = 'org.webkit:android-jsc:+'\n \n /**\n- * Whether to enable the Hermes VM.\n- *\n- * This should be set on project.ext.react and that value will be read here. If it is not set\n- * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode\n- * and the benefits of using Hermes will therefore be sharply reduced.\n- */\n-def enableHermes = project.ext.react.get(\"enableHermes\", false);\n-\n-/**\n- * Architectures to build native code for.\n+ * Private function to get the list of Native Architectures you want to build.\n+ * This reads the value from reactNativeArchitectures in your gradle.properties\n+ * file and works together with the --active-arch-only flag of react-native run-android.\n */\n def reactNativeArchitectures() {\n def value = project.getProperties().get(\"reactNativeArchitectures\")\n@@ -142,85 +113,13 @@ android {\n \n compileSdkVersion rootProject.ext.compileSdkVersion\n \n+ namespace \"com.helloworld\"\n defaultConfig {\n applicationId \"com.helloworld\"\n minSdkVersion rootProject.ext.minSdkVersion\n targetSdkVersion rootProject.ext.targetSdkVersion\n versionCode 1\n versionName \"1.0\"\n- buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- arguments \"APP_PLATFORM=android-21\",\n- \"APP_STL=c++_shared\",\n- \"NDK_TOOLCHAIN_VERSION=clang\",\n- \"GENERATED_SRC_DIR=$buildDir/generated/source\",\n- \"PROJECT_BUILD_DIR=$buildDir\",\n- \"REACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid\",\n- \"REACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build\",\n- \"NODE_MODULES_DIR=$rootDir/../node_modules\"\n- cFlags \"-Wall\", \"-Werror\", \"-fexceptions\", \"-frtti\", \"-DWITH_INSPECTOR=1\"\n- cppFlags \"-std=c++17\"\n- // Make sure this target name is the same you specify inside the\n- // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.\n- targets \"helloworld_appmodules\"\n-\n- // Fix for windows limit on number of character in file paths and in command lines\n- if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n- arguments \"NDK_APP_SHORT_COMMANDS=true\"\n- }\n- }\n- }\n- if (!enableSeparateBuildPerCPUArchitecture) {\n- ndk {\n- abiFilters (*reactNativeArchitectures())\n- }\n- }\n- }\n- }\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- path \"$projectDir/src/main/jni/Android.mk\"\n- }\n- }\n- def reactAndroidProjectDir = project(':ReactAndroid').projectDir\n- def packageReactNdkDebugLibs = tasks.register(\"packageReactNdkDebugLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkDebugLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- def packageReactNdkReleaseLibs = tasks.register(\"packageReactNdkReleaseLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkReleaseLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- afterEvaluate {\n- // If you wish to add a custom TurboModule or component locally,\n- // you should uncomment this line.\n- // preBuild.dependsOn(\"generateCodegenArtifactsFromSchema\")\n- preDebugBuild.dependsOn(packageReactNdkDebugLibs)\n- preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)\n-\n- // Due to a bug inside AGP, we have to explicitly set a dependency\n- // between configureNdkBuild* tasks and the preBuild tasks.\n- // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732\n- configureNdkBuildRelease.dependsOn(preReleaseBuild)\n- configureNdkBuildDebug.dependsOn(preDebugBuild)\n- reactNativeArchitectures().each { architecture ->\n- tasks.findByName(\"configureNdkBuildDebug[${architecture}]\")?.configure {\n- dependsOn(\"preDebugBuild\")\n- }\n- tasks.findByName(\"configureNdkBuildRelease[${architecture}]\")?.configure {\n- dependsOn(\"preReleaseBuild\")\n- }\n- }\n- }\n }\n \n splits {\n@@ -247,6 +146,7 @@ android {\n // Caution! In production, you need to generate your own keystore file.\n // see https://reactnative.dev/docs/signed-apk-android.\n signingConfig signingConfigs.debug\n+ shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)\n minifyEnabled enableProguardInReleaseBuilds\n proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n }\n@@ -257,11 +157,12 @@ android {\n variant.outputs.each { output ->\n // For each separate APK per architecture, set a unique version code as described here:\n // https://developer.android.com/studio/build/configure-apk-splits.html\n+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.\n def versionCodes = [\"armeabi-v7a\": 1, \"x86\": 2, \"arm64-v8a\": 3, \"x86_64\": 4]\n def abi = output.getFilter(OutputFile.ABI)\n if (abi != null) { // null for the universal-debug, universal-release variants\n output.versionCodeOverride =\n- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)\n }\n \n }\n@@ -289,10 +190,8 @@ android {\n }\n \n dependencies {\n- implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n-\n- //noinspection GradleDynamicVersion\n- implementation \"com.facebook.react:react-native:+\" // From node_modules\n+ // The version of react-native is set by the React Native Gradle Plugin\n+ implementation(\"com.facebook.react:react-android\")\n \n def isGifEnabled = (findProperty('expo.gif.enabled') ?: \"\") == \"true\";\n def isWebpEnabled = (findProperty('expo.webp.enabled') ?: \"\") == \"true\";\n@@ -301,76 +200,38 @@ dependencies {\n \n // If your app supports Android versions before Ice Cream Sandwich (API level 14)\n if (isGifEnabled || isWebpEnabled) {\n- implementation \"com.facebook.fresco:fresco:${frescoVersion}\"\n- implementation \"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:fresco:${frescoVersion}\")\n+ implementation(\"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\")\n }\n \n if (isGifEnabled) {\n // For animated gif support\n- implementation \"com.facebook.fresco:animated-gif:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-gif:${frescoVersion}\")\n }\n \n if (isWebpEnabled) {\n // For webp support\n- implementation \"com.facebook.fresco:webpsupport:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:webpsupport:${frescoVersion}\")\n if (isWebpAnimatedEnabled) {\n // Animated webp support\n- implementation \"com.facebook.fresco:animated-webp:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-webp:${frescoVersion}\")\n }\n }\n \n- implementation \"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\"\n- debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.fbjni'\n- }\n+ implementation(\"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\")\n+\n+ debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\")\n debugImplementation(\"com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n exclude group:'com.squareup.okhttp3', module:'okhttp'\n }\n- debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n- }\n+ debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\")\n \n- if (enableHermes) {\n- //noinspection GradleDynamicVersion\n- implementation(\"com.facebook.react:hermes-engine:+\") { // From node_modules\n- exclude group:'com.facebook.fbjni'\n- }\n+ if (hermesEnabled.toBoolean()) {\n+ implementation(\"com.facebook.react:hermes-android\")\n } else {\n implementation jscFlavor\n }\n }\n \n-if (isNewArchitectureEnabled()) {\n- // If new architecture is enabled, we let you build RN from source\n- // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.\n- // This will be applied to all the imported transtitive dependency.\n- configurations.all {\n- resolutionStrategy.dependencySubstitution {\n- substitute(module(\"com.facebook.react:react-native\"))\n- .using(project(\":ReactAndroid\"))\n- .because(\"On New Architecture we're building React Native from source\")\n- substitute(module(\"com.facebook.react:hermes-engine\"))\n- .using(project(\":ReactAndroid:hermes-engine\"))\n- .because(\"On New Architecture we're building Hermes from source\")\n- }\n- }\n-}\n-\n-// Run this once to be able to run the application with BUCK\n-// puts all compile dependencies into folder libs for BUCK to use\n-task copyDownloadableDepsToLibs(type: Copy) {\n- from configurations.implementation\n- into 'libs'\n-}\n-\n apply from: new File([\"node\", \"--print\", \"require.resolve('@react-native-community/cli-platform-android/package.json')\"].execute(null, rootDir).text.trim(), \"../native_modules.gradle\");\n applyNativeModulesAppBuildGradle(project)\n-\n-def isNewArchitectureEnabled() {\n- // To opt-in for the New Architecture, you can either:\n- // - Set `newArchEnabled` to true inside the `gradle.properties` file\n- // - Invoke gradle with `-newArchEnabled=true`\n- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`\n- return project.hasProperty(\"newArchEnabled\") && project.newArchEnabled == \"true\"\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/build_defs.bzl b/templates/expo-template-bare-minimum/android/app/build_defs.bzl\ndeleted file mode 100644\nindex fff270f8d1..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/build_defs.bzl\n+++ /dev/null\n@@ -1,19 +0,0 @@\n-\"\"\"Helper definitions to glob .aar and .jar targets\"\"\"\n-\n-def create_aar_targets(aarfiles):\n- for aarfile in aarfiles:\n- name = \"aars__\" + aarfile[aarfile.rindex(\"/\") + 1:aarfile.rindex(\".aar\")]\n- lib_deps.append(\":\" + name)\n- android_prebuilt_aar(\n- name = name,\n- aar = aarfile,\n- )\n-\n-def create_jar_targets(jarfiles):\n- for jarfile in jarfiles:\n- name = \"jars__\" + jarfile[jarfile.rindex(\"/\") + 1:jarfile.rindex(\".jar\")]\n- lib_deps.append(\":\" + name)\n- prebuilt_jar(\n- name = name,\n- binary_jar = jarfile,\n- )\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\nindex 8cddb11cb2..595dd5831c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n@@ -1,5 +1,5 @@\n /**\n- * Copyright (c) Facebook, Inc. and its affiliates.\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *

This source code is licensed under the MIT license found in the LICENSE file in the root\n * directory of this source tree.\n@@ -17,22 +17,27 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping;\n import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;\n import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;\n import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;\n-import com.facebook.flipper.plugins.react.ReactFlipperPlugin;\n import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;\n+import com.facebook.react.ReactInstanceEventListener;\n import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.bridge.ReactContext;\n import com.facebook.react.modules.network.NetworkingModule;\n import okhttp3.OkHttpClient;\n \n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the debug\n+ * flavor of it. Here you can add your own plugins and customize the Flipper setup.\n+ */\n public class ReactNativeFlipper {\n public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n if (FlipperUtils.shouldEnableFlipper(context)) {\n final FlipperClient client = AndroidFlipperClient.getInstance(context);\n+\n client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));\n- client.addPlugin(new ReactFlipperPlugin());\n client.addPlugin(new DatabasesFlipperPlugin(context));\n client.addPlugin(new SharedPreferencesFlipperPlugin(context));\n client.addPlugin(CrashReporterPlugin.getInstance());\n+\n NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();\n NetworkingModule.setCustomClientBuilder(\n new NetworkingModule.CustomClientBuilder() {\n@@ -43,12 +48,13 @@ public class ReactNativeFlipper {\n });\n client.addPlugin(networkFlipperPlugin);\n client.start();\n+\n // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized\n // Hence we run if after all native modules have been initialized\n ReactContext reactContext = reactInstanceManager.getCurrentReactContext();\n if (reactContext == null) {\n reactInstanceManager.addReactInstanceEventListener(\n- new ReactInstanceManager.ReactInstanceEventListener() {\n+ new ReactInstanceEventListener() {\n @Override\n public void onReactContextInitialized(ReactContext reactContext) {\n reactInstanceManager.removeReactInstanceEventListener(this);\n@@ -66,4 +72,4 @@ public class ReactNativeFlipper {\n }\n }\n }\n-}\n\\ No newline at end of file\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\nindex 0cad655b33..6536fc03ad 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n@@ -1,4 +1,4 @@\n-\n+\n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 8e13797d9b..7e2823fb6c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -29,15 +30,20 @@ public class MainActivity extends ReactActivity {\n }\n \n /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled\n+ // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).\n+ DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled\n+ ));\n }\n \n /**\n@@ -59,25 +65,4 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..31c2b288c1 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,70 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \"index\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +73,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex cda1391225..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source\n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_runtime \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\nnew file mode 100644\nindex 0000000000..b510364404\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\n@@ -0,0 +1,20 @@\n+/**\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n+ *\n+ *

This source code is licensed under the MIT license found in the LICENSE file in the root\n+ * directory of this source tree.\n+ */\n+package com.helloworld;\n+\n+import android.content.Context;\n+import com.facebook.react.ReactInstanceManager;\n+\n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the release\n+ * flavor of it so it's empty as we don't want to load Flipper.\n+ */\n+public class ReactNativeFlipper {\n+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n+ // Do nothing as we don't want to initialize Flipper on Release.\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/build.gradle b/templates/expo-template-bare-minimum/android/build.gradle\nindex f259b31a11..e5fda82878 100644\n--- a/templates/expo-template-bare-minimum/android/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/build.gradle\n@@ -1,49 +1,31 @@\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n // Top-level build file where you can add configuration options common to all sub-projects/modules.\n+\n buildscript {\n ext {\n- buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'\n+ buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0'\n minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')\n- compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')\n- targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')\n+ compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33')\n+ targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33')\n if (findProperty('android.kotlinVersion')) {\n kotlinVersion = findProperty('android.kotlinVersion')\n }\n frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'\n \n- if (System.properties['os.arch'] == 'aarch64') {\n- // For M1 Users we need to use the NDK 24 which added support for aarch64\n- ndkVersion = '24.0.8215888'\n- } else {\n- // Otherwise we default to the side-by-side NDK version from AGP.\n- ndkVersion = '21.4.7075529'\n- }\n+ // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.\n+ ndkVersion = \"23.1.7779620\"\n }\n repositories {\n google()\n mavenCentral()\n }\n dependencies {\n- classpath('com.android.tools.build:gradle:7.1.1')\n+ classpath('com.android.tools.build:gradle:7.4.1')\n classpath('com.facebook.react:react-native-gradle-plugin')\n- classpath('de.undercouch:gradle-download-task:5.0.1')\n- // NOTE: Do not place your application dependencies here; they belong\n- // in the individual module build.gradle files\n }\n }\n \n-def REACT_NATIVE_VERSION = new File(['node', '--print',\"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n-\n allprojects {\n- configurations.all {\n- resolutionStrategy {\n- force \"com.facebook.react:react-native:\" + REACT_NATIVE_VERSION\n- }\n- }\n-\n repositories {\n- mavenLocal()\n maven {\n // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm\n url(new File(['node', '--print', \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), '../android'))\n@@ -54,19 +36,7 @@ allprojects {\n }\n \n google()\n- mavenCentral {\n- // We don't want to fetch react-native from Maven Central as there are\n- // older versions over there.\n- content {\n- excludeGroup 'com.facebook.react'\n- }\n- }\n+ mavenCentral()\n maven { url 'https://www.jitpack.io' }\n }\n }\n-\n-configurations.all {\n- resolutionStrategy {\n- force 'com.facebook.react:react-native:0.69.6'\n- }\n-}\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/gitignore b/templates/expo-template-bare-minimum/android/gitignore\nindex 64436baaf5..877b87e9a5 100644\n--- a/templates/expo-template-bare-minimum/android/gitignore\n+++ b/templates/expo-template-bare-minimum/android/gitignore\n@@ -11,11 +11,5 @@ local.properties\n *.iml\n *.hprof\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/android/gradle.properties b/templates/expo-template-bare-minimum/android/gradle.properties\nindex fab3fb6bcf..9911ac4afd 100644\n--- a/templates/expo-template-bare-minimum/android/gradle.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle.properties\n@@ -42,7 +42,7 @@ newArchEnabled=false\n \n # The hosted JavaScript engine\n # Supported values: expo.jsEngine = \"hermes\" | \"jsc\"\n-expo.jsEngine=jsc\n+expo.jsEngine=hermes\n \n # Enable GIF support in React Native images (~200 B increase)\n expo.gif.enabled=true\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar\nindex 7454180f2a..249e5832f0 100644\nBinary files a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar and b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.jar differ\ndiff --git a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\nindex 669386b870..8fad3f5a98 100644\n--- a/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle/wrapper/gradle-wrapper.properties\n@@ -1,5 +1,5 @@\n distributionBase=GRADLE_USER_HOME\n distributionPath=wrapper/dists\n-distributionUrl=https\\://services.gradle.org/distributions/gradle-7.3.3-all.zip\n+distributionUrl=https\\://services.gradle.org/distributions/gradle-7.5.1-all.zip\n zipStoreBase=GRADLE_USER_HOME\n zipStorePath=wrapper/dists\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew b/templates/expo-template-bare-minimum/android/gradlew\nindex 1b6c787337..a69d9cb6c2 100755\n--- a/templates/expo-template-bare-minimum/android/gradlew\n+++ b/templates/expo-template-bare-minimum/android/gradlew\n@@ -205,6 +205,12 @@ set -- \\\n org.gradle.wrapper.GradleWrapperMain \\\n \"$@\"\n \n+# Stop when \"xargs\" is not available.\n+if ! command -v xargs >/dev/null 2>&1\n+then\n+ die \"xargs is not available\"\n+fi\n+\n # Use \"xargs\" to parse quoted args.\n #\n # With -n1 it outputs one arg per line, with the quotes and backslashes removed.\ndiff --git a/templates/expo-template-bare-minimum/android/gradlew.bat b/templates/expo-template-bare-minimum/android/gradlew.bat\nindex ac1b06f938..53a6b238d4 100644\n--- a/templates/expo-template-bare-minimum/android/gradlew.bat\n+++ b/templates/expo-template-bare-minimum/android/gradlew.bat\n@@ -14,7 +14,7 @@\n @rem limitations under the License.\r\n @rem\r\n \r\n-@if \"%DEBUG%\" == \"\" @echo off\r\n+@if \"%DEBUG%\"==\"\" @echo off\r\n @rem ##########################################################################\r\n @rem\r\n @rem Gradle startup script for Windows\r\n@@ -25,7 +25,7 @@\n if \"%OS%\"==\"Windows_NT\" setlocal\r\n \r\n set DIRNAME=%~dp0\r\n-if \"%DIRNAME%\" == \"\" set DIRNAME=.\r\n+if \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n set APP_BASE_NAME=%~n0\r\n set APP_HOME=%DIRNAME%\r\n \r\n@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome\n \r\n set JAVA_EXE=java.exe\r\n %JAVA_EXE% -version >NUL 2>&1\r\n-if \"%ERRORLEVEL%\" == \"0\" goto execute\r\n+if %ERRORLEVEL% equ 0 goto execute\r\n \r\n echo.\r\n echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\n@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n \r\n :end\r\n @rem End local scope for the variables with windows NT shell\r\n-if \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n+if %ERRORLEVEL% equ 0 goto mainEnd\r\n \r\n :fail\r\n rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\n rem the _cmd.exe /c_ return code!\r\n-if not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\n-exit /b 1\r\n+set EXIT_CODE=%ERRORLEVEL%\r\n+if %EXIT_CODE% equ 0 set EXIT_CODE=1\r\n+if not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\n+exit /b %EXIT_CODE%\r\n \r\n :mainEnd\r\n if \"%OS%\"==\"Windows_NT\" endlocal\r\ndiff --git a/templates/expo-template-bare-minimum/android/settings.gradle b/templates/expo-template-bare-minimum/android/settings.gradle\nindex b3332319f9..1dc416e7c1 100644\n--- a/templates/expo-template-bare-minimum/android/settings.gradle\n+++ b/templates/expo-template-bare-minimum/android/settings.gradle\n@@ -8,10 +8,3 @@ applyNativeModulesSettingsGradle(settings)\n \n include ':app'\n includeBuild(new File([\"node\", \"--print\", \"require.resolve('react-native-gradle-plugin/package.json')\"].execute(null, rootDir).text.trim()).getParentFile())\n-\n-if (settings.hasProperty(\"newArchEnabled\") && settings.newArchEnabled == \"true\") {\n- include(\":ReactAndroid\")\n- project(\":ReactAndroid\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid\");\n- include(\":ReactAndroid:hermes-engine\")\n- project(\":ReactAndroid:hermes-engine\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid/hermes-engine\");\n-}\ndiff --git a/templates/expo-template-bare-minimum/gitignore b/templates/expo-template-bare-minimum/gitignore\nindex c8eb0f9a64..df57ba88a1 100644\n--- a/templates/expo-template-bare-minimum/gitignore\n+++ b/templates/expo-template-bare-minimum/gitignore\n@@ -30,6 +30,9 @@ build/\n local.properties\n *.iml\n *.hprof\n+.cxx/\n+*.keystore\n+!debug.keystore\n \n # node.js\n #\n@@ -37,18 +40,15 @@ node_modules/\n npm-debug.log\n yarn-error.log\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\n \n # CocoaPods\n /ios/Pods/\n \n+# Temporary files created by Metro to check the health of the file watcher\n+.metro-health-check*\n+\n # Expo\n .expo/\n web-build/\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\nindex a4a049f05d..98e6c2afea 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n@@ -214,7 +214,7 @@\n \t\t\t);\n \t\t\trunOnlyForDeploymentPostprocessing = 0;\n \t\t\tshellPath = /bin/sh;\n-\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n+\t\t\tshellScript = \"if [[ -f \\\"$PODS_ROOT/../.xcode.env\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env\\\"\\nfi\\nif [[ -f \\\"$PODS_ROOT/../.xcode.env.local\\\" ]]; then\\n source \\\"$PODS_ROOT/../.xcode.env.local\\\"\\nfi\\n\\n# The project root by default is one level up from the ios directory\\nexport PROJECT_ROOT=\\\"$PROJECT_DIR\\\"/..\\n\\nif [[ \\\"$CONFIGURATION\\\" = *Debug* ]]; then\\n export SKIP_BUNDLING=1\\nfi\\nif [[ -z \\\"$ENTRY_FILE\\\" ]]; then\\n # Set the entry JS file using the bundler's entry resolution.\\n export ENTRY_FILE=\\\"$(\\\"$NODE_BINARY\\\" -e \\\"require('expo/scripts/resolveAppEntry')\\\" $PROJECT_ROOT ios relative | tail -n 1)\\\"\\nfi\\n\\n`\\\"$NODE_BINARY\\\" --print \\\"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\\\"`\\n\\n\";\n \t\t};\n \t\t08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {\n \t\t\tisa = PBXShellScriptBuildPhase;\n@@ -308,8 +308,9 @@\n \t\t\t\t\t\"FB_SONARKIT_ENABLED=1\",\n \t\t\t\t);\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -331,8 +332,9 @@\n \t\t\t\tCLANG_ENABLE_MODULES = YES;\n \t\t\t\tCURRENT_PROJECT_VERSION = 1;\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -392,7 +394,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n@@ -441,7 +443,7 @@\n \t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n \t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n \t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n-\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.4;\n+\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"/usr/lib/swift $(inherited)\";\n \t\t\t\tLIBRARY_SEARCH_PATHS = \"\\\"$(inherited)\\\"\";\n \t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\nindex f7d2972042..1658a437eb 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n@@ -1,9 +1,7 @@\n-#import \n-#import \n+#import \n #import \n-\n #import \n \n-@interface AppDelegate : EXAppDelegateWrapper \n+@interface AppDelegate : EXAppDelegateWrapper\n \n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\nindex a6e13e11ab..8cb5aef137 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n@@ -1,100 +1,40 @@\n #import \"AppDelegate.h\"\n \n-#import \n #import \n-#import \n #import \n-#import \n-\n-#import \n-\n-#if RCT_NEW_ARCH_ENABLED\n-#import \n-#import \n-#import \n-#import \n-#import \n-#import \n-\n-#import \n-\n-static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n-\n-@interface AppDelegate () {\n- RCTTurboModuleManager *_turboModuleManager;\n- RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;\n- std::shared_ptr _reactNativeConfig;\n- facebook::react::ContextContainer::Shared _contextContainer;\n-}\n-@end\n-#endif\n \n @implementation AppDelegate\n \n - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n {\n- RCTAppSetupPrepareApp(application);\n-\n- RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];\n-\n-#if RCT_NEW_ARCH_ENABLED\n- _contextContainer = std::make_shared();\n- _reactNativeConfig = std::make_shared();\n- _contextContainer->insert(\"ReactNativeConfig\", _reactNativeConfig);\n- _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];\n- bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;\n-#endif\n-\n- NSDictionary *initProps = [self prepareInitialProps];\n- UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:initProps];\n-\n- rootView.backgroundColor = [UIColor whiteColor];\n- self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n- UIViewController *rootViewController = [self.reactDelegate createRootViewController];\n- rootViewController.view = rootView;\n- self.window.rootViewController = rootViewController;\n- [self.window makeKeyAndVisible];\n+ self.moduleName = @\"main\";\n \n- [super application:application didFinishLaunchingWithOptions:launchOptions];\n+ // You can add your custom initial props in the dictionary below.\n+ // They will be passed down to the ViewController used by React Native.\n+ self.initialProps = @{};\n \n- return YES;\n+ return [super application:application didFinishLaunchingWithOptions:launchOptions];\n }\n \n-- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge\n+- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n {\n- // If you'd like to export some custom RCTBridgeModules, add them here!\n- return @[];\n+#if DEBUG\n+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n+#else\n+ return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n+#endif\n }\n \n /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.\n ///\n /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html\n /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).\n-/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.\n+/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.\n - (BOOL)concurrentRootEnabled\n {\n- // Switch this bool to turn on and off the concurrent root\n return true;\n }\n \n-- (NSDictionary *)prepareInitialProps\n-{\n- NSMutableDictionary *initProps = [NSMutableDictionary new];\n-#if RCT_NEW_ARCH_ENABLED\n- initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);\n-#endif\n- return initProps;\n-}\n-\n-- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n-{\n-#if DEBUG\n- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n-#else\n- return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n-#endif\n-}\n-\n // Linking API\n - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options {\n return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];\n@@ -124,43 +64,4 @@ static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];\n }\n \n-#if RCT_NEW_ARCH_ENABLED\n-\n-#pragma mark - RCTCxxBridgeDelegate\n-\n-- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge\n-{\n- _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge\n- delegate:self\n- jsInvoker:bridge.jsCallInvoker];\n- return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);\n-}\n-\n-#pragma mark RCTTurboModuleManagerDelegate\n-\n-- (Class)getModuleClassFromName:(const char *)name\n-{\n- return RCTCoreModulesClassProvider(name);\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- jsInvoker:(std::shared_ptr)jsInvoker\n-{\n- return nullptr;\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- initParams:\n- (const facebook::react::ObjCTurboModule::InitParams &)params\n-{\n- return nullptr;\n-}\n-\n-- (id)getModuleInstanceFromClass:(Class)moduleClass\n-{\n- return RCTAppSetupDefaultModuleFromClass(moduleClass);\n-}\n-\n-#endif\n-\n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile b/templates/expo-template-bare-minimum/ios/Podfile\nindex 91612acca9..e523ea5cac 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile\n+++ b/templates/expo-template-bare-minimum/ios/Podfile\n@@ -5,36 +5,67 @@ require File.join(File.dirname(`node --print \"require.resolve('@react-native-com\n require 'json'\n podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}\n \n-platform :ios, podfile_properties['ios.deploymentTarget'] || '12.4'\n+ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'\n+ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = '1' if podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == 'true'\n+\n+platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'\n install! 'cocoapods',\n :deterministic_uuids => false\n \n+prepare_react_native_project!\n+\n+# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.\n+# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,\n+# you can also exclude `react-native-flipper` in `react-native.config.js`\n+#\n+# ```js\n+# module.exports = {\n+# dependencies: {\n+# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),\n+# }\n+# }\n+# ```\n+flipper_config = FlipperConfiguration.disabled\n+if ENV['NO_FLIPPER'] == '1' then\n+ # Explicitly disabled through environment variables\n+ flipper_config = FlipperConfiguration.disabled\n+elsif podfile_properties.key?('ios.flipper') then\n+ # Configure Flipper in Podfile.properties.json\n+ if podfile_properties['ios.flipper'] == 'true' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"])\n+ elsif podfile_properties['ios.flipper'] != 'false' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"], { 'Flipper' => podfile_properties['ios.flipper'] })\n+ end\n+end\n+\n target 'HelloWorld' do\n use_expo_modules!\n config = use_native_modules!\n \n use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']\n+ use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']\n \n # Flags change depending on the env values.\n flags = get_default_flags()\n \n use_react_native!(\n :path => config[:reactNativePath],\n- :hermes_enabled => flags[:hermes_enabled] || podfile_properties['expo.jsEngine'] == 'hermes',\n+ :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',\n :fabric_enabled => flags[:fabric_enabled],\n # An absolute path to your application root.\n- :app_path => \"#{Dir.pwd}/..\"\n+ :app_path => \"#{Pod::Config.instance.installation_root}/..\",\n+ # Note that if you have use_frameworks! enabled, Flipper will not work if enabled\n+ :flipper_configuration => flipper_config\n )\n \n- # Uncomment to opt-in to using Flipper\n- # Note that if you have use_frameworks! enabled, Flipper will not work\n- #\n- # if !ENV['CI']\n- # use_flipper!()\n- # end\n-\n post_install do |installer|\n- react_native_post_install(installer)\n+ react_native_post_install(\n+ installer,\n+ config[:reactNativePath],\n+ # Set `mac_catalyst_enabled` to `true` in order to apply patches\n+ # necessary for Mac Catalyst builds\n+ :mac_catalyst_enabled => false\n+ )\n __apply_Xcode_12_5_M1_post_install_workaround(installer)\n \n # This is necessary for Xcode 14, because it signs resource bundles by default\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile.properties.json b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\nindex f6d872e81a..b1bd45da51 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n+++ b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n@@ -1,3 +1,3 @@\n {\n- \"expo.jsEngine\": \"jsc\"\n+ \"expo.jsEngine\": \"hermes\"\n }\ndiff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json\nindex d5ca09a584..d1fcd513cc 100644\n--- a/templates/expo-template-bare-minimum/package.json\n+++ b/templates/expo-template-bare-minimum/package.json\n@@ -1,7 +1,7 @@\n {\n \"name\": \"expo-template-bare-minimum\",\n \"description\": \"This bare project template includes a minimal setup for using unimodules with React Native.\",\n- \"version\": \"46.0.37\",\n+ \"version\": \"48.0.21\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"expo start --dev-client\",\n@@ -10,15 +10,13 @@\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n- \"expo\": \"~46.0.21\",\n- \"expo-splash-screen\": \"~0.16.2\",\n- \"expo-status-bar\": \"~1.4.0\",\n- \"react\": \"18.0.0\",\n- \"react-dom\": \"18.0.0\",\n- \"react-native\": \"0.69.9\",\n- \"react-native-web\": \"~0.18.7\"\n+ \"expo\": \"~48.0.21\",\n+ \"expo-splash-screen\": \"~0.18.2\",\n+ \"expo-status-bar\": \"~1.4.4\",\n+ \"react\": \"18.2.0\",\n+ \"react-native\": \"0.71.14\"\n },\n \"devDependencies\": {\n- \"@babel/core\": \"^7.12.9\"\n+ \"@babel/core\": \"^7.20.0\"\n }\n }\n","47..48":"diff --git a/templates/expo-template-bare-minimum/.buckconfig b/templates/expo-template-bare-minimum/.buckconfig\ndeleted file mode 100644\nindex 934256cb29..0000000000\n--- a/templates/expo-template-bare-minimum/.buckconfig\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-\n-[android]\n- target = Google Inc.:Google APIs:23\n-\n-[maven_repositories]\n- central = https://repo1.maven.org/maven2\ndiff --git a/templates/expo-template-bare-minimum/.npmignore b/templates/expo-template-bare-minimum/.npmignore\nindex 35490b6612..4e6ce00391 100644\n--- a/templates/expo-template-bare-minimum/.npmignore\n+++ b/templates/expo-template-bare-minimum/.npmignore\n@@ -20,3 +20,4 @@ ios/Pods\n android/.build\n android/app/build\n android/.gradle\n+ios/.xcode.env.local\ndiff --git a/templates/expo-template-bare-minimum/android/app/BUCK b/templates/expo-template-bare-minimum/android/app/BUCK\ndeleted file mode 100644\nindex 0e77904834..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/BUCK\n+++ /dev/null\n@@ -1,55 +0,0 @@\n-# To learn about Buck see [Docs](https://buckbuild.com/).\n-# To run your application with Buck:\n-# - install Buck\n-# - `npm start` - to start the packager\n-# - `cd android`\n-# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\"`\n-# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck\n-# - `buck install -r android/app` - compile, install and run application\n-#\n-\n-load(\":build_defs.bzl\", \"create_aar_targets\", \"create_jar_targets\")\n-\n-lib_deps = []\n-\n-create_aar_targets(glob([\"libs/*.aar\"]))\n-\n-create_jar_targets(glob([\"libs/*.jar\"]))\n-\n-android_library(\n- name = \"all-libs\",\n- exported_deps = lib_deps,\n-)\n-\n-android_library(\n- name = \"app-code\",\n- srcs = glob([\n- \"src/main/java/**/*.java\",\n- ]),\n- deps = [\n- \":all-libs\",\n- \":build_config\",\n- \":res\",\n- ],\n-)\n-\n-android_build_config(\n- name = \"build_config\",\n- package = \"com.helloworld\",\n-)\n-\n-android_resource(\n- name = \"res\",\n- package = \"com.helloworld\",\n- res = \"src/main/res\",\n-)\n-\n-android_binary(\n- name = \"app\",\n- keystore = \"//android/keystores:debug\",\n- manifest = \"src/main/AndroidManifest.xml\",\n- package_type = \"debug\",\n- deps = [\n- \":app-code\",\n- ],\n-)\ndiff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex 648135611c..189390e7e3 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -1,135 +1,107 @@\n apply plugin: \"com.android.application\"\n+apply plugin: \"com.facebook.react\"\n \n import com.android.build.OutputFile\n \n-/**\n- * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n- * and bundleReleaseJsAndAssets).\n- * These basically call `react-native bundle` with the correct arguments during the Android build\n- * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the\n- * bundle directly from the development server. Below you can see all the possible configurations\n- * and their defaults. If you decide to add a configuration block, make sure to add it before the\n- * `apply from: \"../../node_modules/react-native/react.gradle\"` line.\n- *\n- * project.ext.react = [\n- * // the name of the generated asset file containing your JS bundle\n- * bundleAssetName: \"index.android.bundle\",\n- *\n- * // the entry file for bundle generation. If none specified and\n- * // \"index.android.js\" exists, it will be used. Otherwise \"index.js\" is\n- * // default. Can be overridden with ENTRY_FILE environment variable.\n- * entryFile: \"index.android.js\",\n- *\n- * // https://reactnative.dev/docs/performance#enable-the-ram-format\n- * bundleCommand: \"ram-bundle\",\n- *\n- * // whether to bundle JS and assets in debug mode\n- * bundleInDebug: false,\n- *\n- * // whether to bundle JS and assets in release mode\n- * bundleInRelease: true,\n- *\n- * // whether to bundle JS and assets in another build variant (if configured).\n- * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants\n- * // The configuration property can be in the following formats\n- * // 'bundleIn${productFlavor}${buildType}'\n- * // 'bundleIn${buildType}'\n- * // bundleInFreeDebug: true,\n- * // bundleInPaidRelease: true,\n- * // bundleInBeta: true,\n- *\n- * // whether to disable dev mode in custom build variants (by default only disabled in release)\n- * // for example: to disable dev mode in the staging build type (if configured)\n- * devDisabledInStaging: true,\n- * // The configuration property can be in the following formats\n- * // 'devDisabledIn${productFlavor}${buildType}'\n- * // 'devDisabledIn${buildType}'\n- *\n- * // the root of your project, i.e. where \"package.json\" lives\n- * root: \"../../\",\n- *\n- * // where to put the JS bundle asset in debug mode\n- * jsBundleDirDebug: \"$buildDir/intermediates/assets/debug\",\n- *\n- * // where to put the JS bundle asset in release mode\n- * jsBundleDirRelease: \"$buildDir/intermediates/assets/release\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in debug mode\n- * resourcesDirDebug: \"$buildDir/intermediates/res/merged/debug\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in release mode\n- * resourcesDirRelease: \"$buildDir/intermediates/res/merged/release\",\n- *\n- * // by default the gradle tasks are skipped if none of the JS files or assets change; this means\n- * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to\n- * // date; if you have any other folders that you want to ignore for performance reasons (gradle\n- * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/\n- * // for example, you might want to remove it from here.\n- * inputExcludes: [\"android/**\", \"ios/**\"],\n- *\n- * // override which node gets called and with what additional arguments\n- * nodeExecutableAndArgs: [\"node\"],\n- *\n- * // supply additional arguments to the packager\n- * extraPackagerArgs: []\n- * ]\n- */\n-\n def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()\n+def expoDebuggableVariants = ['debug']\n+// Override `debuggableVariants` for expo-updates debugging\n+if (System.getenv('EX_UPDATES_NATIVE_DEBUG') == \"1\") {\n+ react {\n+ expoDebuggableVariants = []\n+ }\n+}\n \n-def reactNativeRoot = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath()\n \n-project.ext.react = [\n- entryFile: [\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\"].execute(null, rootDir).text.trim(),\n- enableHermes: (findProperty('expo.jsEngine') ?: \"jsc\") == \"hermes\",\n- hermesCommand: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\",\n- cliPath: \"${reactNativeRoot}/cli.js\",\n- composeSourceMapsPath: \"${reactNativeRoot}/scripts/compose-source-maps.js\",\n-]\n+/**\n+ * This is the configuration block to customize your React Native Android app.\n+ * By default you don't need to apply any configuration, just uncomment the lines you need.\n+ */\n+react {\n+ entryFile = file([\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\", \"absolute\"].execute(null, rootDir).text.trim())\n+ reactNativeDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()\n+ hermesCommand = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\"\n+ debuggableVariants = expoDebuggableVariants\n+\n+ /* Folders */\n+ // The root of your project, i.e. where \"package.json\" lives. Default is '..'\n+ // root = file(\"../\")\n+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native\n+ // reactNativeDir = file(\"../node_modules/react-native\")\n+ // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen\n+ // codegenDir = file(\"../node_modules/react-native-codegen\")\n+ // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js\n+ // cliFile = file(\"../node_modules/react-native/cli.js\")\n+\n+ /* Variants */\n+ // The list of variants to that are debuggable. For those we're going to\n+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.\n+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.\n+ // debuggableVariants = [\"liteDebug\", \"prodDebug\"]\n+\n+ /* Bundling */\n+ // A list containing the node command and its flags. Default is just 'node'.\n+ // nodeExecutableAndArgs = [\"node\"]\n+ //\n+ // The command to run when bundling. By default is 'bundle'\n+ // bundleCommand = \"ram-bundle\"\n+ //\n+ // The path to the CLI configuration file. Default is empty.\n+ // bundleConfig = file(../rn-cli.config.js)\n+ //\n+ // The name of the generated asset file containing your JS bundle\n+ // bundleAssetName = \"MyApplication.android.bundle\"\n+ //\n+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'\n+ // entryFile = file(\"../js/MyApplication.android.js\")\n+ //\n+ // A list of extra flags to pass to the 'bundle' commands.\n+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle\n+ // extraPackagerArgs = []\n+\n+ /* Hermes Commands */\n+ // The hermes compiler command to run. By default it is 'hermesc'\n+ // hermesCommand = \"$rootDir/my-custom-hermesc/bin/hermesc\"\n+ //\n+ // The list of flags to pass to the Hermes compiler. By default is \"-O\", \"-output-source-map\"\n+ // hermesFlags = [\"-O\", \"-output-source-map\"]\n+}\n \n-apply from: new File(reactNativeRoot, \"react.gradle\")\n+// Override `hermesEnabled` by `expo.jsEngine`\n+ext {\n+ hermesEnabled = (findProperty('expo.jsEngine') ?: \"hermes\") == \"hermes\"\n+}\n \n /**\n- * Set this to true to create two separate APKs instead of one:\n- * - An APK that only works on ARM devices\n- * - An APK that only works on x86 devices\n- * The advantage is the size of the APK is reduced by about 4MB.\n- * Upload all the APKs to the Play Store and people will download\n- * the correct one based on the CPU architecture of their device.\n+ * Set this to true to create four separate APKs instead of one,\n+ * one for each native architecture. This is useful if you don't\n+ * use App Bundles (https://developer.android.com/guide/app-bundle/)\n+ * and want to have separate APKs to upload to the Play Store.\n */\n def enableSeparateBuildPerCPUArchitecture = false\n \n /**\n- * Run Proguard to shrink the Java bytecode in release builds.\n+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.\n */\n def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()\n \n /**\n- * The preferred build flavor of JavaScriptCore.\n+ * The preferred build flavor of JavaScriptCore (JSC)\n *\n * For example, to use the international variant, you can use:\n * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`\n *\n * The international variant includes ICU i18n library and necessary data\n * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that\n- * give correct results when using with locales other than en-US. Note that\n+ * give correct results when using with locales other than en-US. Note that\n * this variant is about 6MiB larger per architecture than default.\n */\n def jscFlavor = 'org.webkit:android-jsc:+'\n \n /**\n- * Whether to enable the Hermes VM.\n- *\n- * This should be set on project.ext.react and that value will be read here. If it is not set\n- * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode\n- * and the benefits of using Hermes will therefore be sharply reduced.\n- */\n-def enableHermes = project.ext.react.get(\"enableHermes\", false);\n-\n-/**\n- * Architectures to build native code for.\n+ * Private function to get the list of Native Architectures you want to build.\n+ * This reads the value from reactNativeArchitectures in your gradle.properties\n+ * file and works together with the --active-arch-only flag of react-native run-android.\n */\n def reactNativeArchitectures() {\n def value = project.getProperties().get(\"reactNativeArchitectures\")\n@@ -141,72 +113,13 @@ android {\n \n compileSdkVersion rootProject.ext.compileSdkVersion\n \n+ namespace \"com.helloworld\"\n defaultConfig {\n applicationId \"com.helloworld\"\n minSdkVersion rootProject.ext.minSdkVersion\n targetSdkVersion rootProject.ext.targetSdkVersion\n versionCode 1\n versionName \"1.0\"\n- buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the CMake build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- cmake {\n- arguments \"-DPROJECT_BUILD_DIR=$buildDir\",\n- \"-DREACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid\",\n- \"-DREACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build\",\n- \"-DNODE_MODULES_DIR=$rootDir/../node_modules\",\n- \"-DANDROID_STL=c++_shared\"\n- }\n- }\n- if (!enableSeparateBuildPerCPUArchitecture) {\n- ndk {\n- abiFilters (*reactNativeArchitectures())\n- }\n- }\n- }\n- }\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the CMake build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- cmake {\n- path \"$projectDir/src/main/jni/CMakeLists.txt\"\n- }\n- }\n- def reactAndroidProjectDir = project(':ReactAndroid').projectDir\n- def packageReactNdkDebugLibs = tasks.register(\"packageReactNdkDebugLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkDebugLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- def packageReactNdkReleaseLibs = tasks.register(\"packageReactNdkReleaseLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkReleaseLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- afterEvaluate {\n- // If you wish to add a custom TurboModule or component locally,\n- // you should uncomment this line.\n- // preBuild.dependsOn(\"generateCodegenArtifactsFromSchema\")\n- preDebugBuild.dependsOn(packageReactNdkDebugLibs)\n- preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)\n-\n- // Due to a bug inside AGP, we have to explicitly set a dependency\n- // between configureCMakeDebug* tasks and the preBuild tasks.\n- // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732\n- configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)\n- configureCMakeDebug.dependsOn(preDebugBuild)\n- reactNativeArchitectures().each { architecture ->\n- tasks.findByName(\"configureCMakeDebug[${architecture}]\")?.configure {\n- dependsOn(\"preDebugBuild\")\n- }\n- tasks.findByName(\"configureCMakeRelWithDebInfo[${architecture}]\")?.configure {\n- dependsOn(\"preReleaseBuild\")\n- }\n- }\n- }\n }\n \n splits {\n@@ -233,6 +146,7 @@ android {\n // Caution! In production, you need to generate your own keystore file.\n // see https://reactnative.dev/docs/signed-apk-android.\n signingConfig signingConfigs.debug\n+ shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)\n minifyEnabled enableProguardInReleaseBuilds\n proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n }\n@@ -243,11 +157,12 @@ android {\n variant.outputs.each { output ->\n // For each separate APK per architecture, set a unique version code as described here:\n // https://developer.android.com/studio/build/configure-apk-splits.html\n+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.\n def versionCodes = [\"armeabi-v7a\": 1, \"x86\": 2, \"arm64-v8a\": 3, \"x86_64\": 4]\n def abi = output.getFilter(OutputFile.ABI)\n if (abi != null) { // null for the universal-debug, universal-release variants\n output.versionCodeOverride =\n- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)\n }\n \n }\n@@ -275,10 +190,8 @@ android {\n }\n \n dependencies {\n- implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n-\n- //noinspection GradleDynamicVersion\n- implementation \"com.facebook.react:react-native:+\" // From node_modules\n+ // The version of react-native is set by the React Native Gradle Plugin\n+ implementation(\"com.facebook.react:react-android\")\n \n def isGifEnabled = (findProperty('expo.gif.enabled') ?: \"\") == \"true\";\n def isWebpEnabled = (findProperty('expo.webp.enabled') ?: \"\") == \"true\";\n@@ -287,76 +200,38 @@ dependencies {\n \n // If your app supports Android versions before Ice Cream Sandwich (API level 14)\n if (isGifEnabled || isWebpEnabled) {\n- implementation \"com.facebook.fresco:fresco:${frescoVersion}\"\n- implementation \"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:fresco:${frescoVersion}\")\n+ implementation(\"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\")\n }\n \n if (isGifEnabled) {\n // For animated gif support\n- implementation \"com.facebook.fresco:animated-gif:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-gif:${frescoVersion}\")\n }\n \n if (isWebpEnabled) {\n // For webp support\n- implementation \"com.facebook.fresco:webpsupport:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:webpsupport:${frescoVersion}\")\n if (isWebpAnimatedEnabled) {\n // Animated webp support\n- implementation \"com.facebook.fresco:animated-webp:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-webp:${frescoVersion}\")\n }\n }\n \n- implementation \"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\"\n- debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.fbjni'\n- }\n+ implementation(\"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\")\n+\n+ debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\")\n debugImplementation(\"com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n exclude group:'com.squareup.okhttp3', module:'okhttp'\n }\n- debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n- }\n+ debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\")\n \n- if (enableHermes) {\n- //noinspection GradleDynamicVersion\n- implementation(\"com.facebook.react:hermes-engine:+\") { // From node_modules\n- exclude group:'com.facebook.fbjni'\n- }\n+ if (hermesEnabled.toBoolean()) {\n+ implementation(\"com.facebook.react:hermes-android\")\n } else {\n implementation jscFlavor\n }\n }\n \n-if (isNewArchitectureEnabled()) {\n- // If new architecture is enabled, we let you build RN from source\n- // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.\n- // This will be applied to all the imported transtitive dependency.\n- configurations.all {\n- resolutionStrategy.dependencySubstitution {\n- substitute(module(\"com.facebook.react:react-native\"))\n- .using(project(\":ReactAndroid\"))\n- .because(\"On New Architecture we're building React Native from source\")\n- substitute(module(\"com.facebook.react:hermes-engine\"))\n- .using(project(\":ReactAndroid:hermes-engine\"))\n- .because(\"On New Architecture we're building Hermes from source\")\n- }\n- }\n-}\n-\n-// Run this once to be able to run the application with BUCK\n-// puts all compile dependencies into folder libs for BUCK to use\n-task copyDownloadableDepsToLibs(type: Copy) {\n- from configurations.implementation\n- into 'libs'\n-}\n-\n apply from: new File([\"node\", \"--print\", \"require.resolve('@react-native-community/cli-platform-android/package.json')\"].execute(null, rootDir).text.trim(), \"../native_modules.gradle\");\n applyNativeModulesAppBuildGradle(project)\n-\n-def isNewArchitectureEnabled() {\n- // To opt-in for the New Architecture, you can either:\n- // - Set `newArchEnabled` to true inside the `gradle.properties` file\n- // - Invoke gradle with `-newArchEnabled=true`\n- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`\n- return project.hasProperty(\"newArchEnabled\") && project.newArchEnabled == \"true\"\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/build_defs.bzl b/templates/expo-template-bare-minimum/android/app/build_defs.bzl\ndeleted file mode 100644\nindex fff270f8d1..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/build_defs.bzl\n+++ /dev/null\n@@ -1,19 +0,0 @@\n-\"\"\"Helper definitions to glob .aar and .jar targets\"\"\"\n-\n-def create_aar_targets(aarfiles):\n- for aarfile in aarfiles:\n- name = \"aars__\" + aarfile[aarfile.rindex(\"/\") + 1:aarfile.rindex(\".aar\")]\n- lib_deps.append(\":\" + name)\n- android_prebuilt_aar(\n- name = name,\n- aar = aarfile,\n- )\n-\n-def create_jar_targets(jarfiles):\n- for jarfile in jarfiles:\n- name = \"jars__\" + jarfile[jarfile.rindex(\"/\") + 1:jarfile.rindex(\".jar\")]\n- lib_deps.append(\":\" + name)\n- prebuilt_jar(\n- name = name,\n- binary_jar = jarfile,\n- )\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\nindex 8cddb11cb2..595dd5831c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n@@ -1,5 +1,5 @@\n /**\n- * Copyright (c) Facebook, Inc. and its affiliates.\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *

This source code is licensed under the MIT license found in the LICENSE file in the root\n * directory of this source tree.\n@@ -17,22 +17,27 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping;\n import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;\n import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;\n import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;\n-import com.facebook.flipper.plugins.react.ReactFlipperPlugin;\n import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;\n+import com.facebook.react.ReactInstanceEventListener;\n import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.bridge.ReactContext;\n import com.facebook.react.modules.network.NetworkingModule;\n import okhttp3.OkHttpClient;\n \n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the debug\n+ * flavor of it. Here you can add your own plugins and customize the Flipper setup.\n+ */\n public class ReactNativeFlipper {\n public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n if (FlipperUtils.shouldEnableFlipper(context)) {\n final FlipperClient client = AndroidFlipperClient.getInstance(context);\n+\n client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));\n- client.addPlugin(new ReactFlipperPlugin());\n client.addPlugin(new DatabasesFlipperPlugin(context));\n client.addPlugin(new SharedPreferencesFlipperPlugin(context));\n client.addPlugin(CrashReporterPlugin.getInstance());\n+\n NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();\n NetworkingModule.setCustomClientBuilder(\n new NetworkingModule.CustomClientBuilder() {\n@@ -43,12 +48,13 @@ public class ReactNativeFlipper {\n });\n client.addPlugin(networkFlipperPlugin);\n client.start();\n+\n // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized\n // Hence we run if after all native modules have been initialized\n ReactContext reactContext = reactInstanceManager.getCurrentReactContext();\n if (reactContext == null) {\n reactInstanceManager.addReactInstanceEventListener(\n- new ReactInstanceManager.ReactInstanceEventListener() {\n+ new ReactInstanceEventListener() {\n @Override\n public void onReactContextInitialized(ReactContext reactContext) {\n reactInstanceManager.removeReactInstanceEventListener(this);\n@@ -66,4 +72,4 @@ public class ReactNativeFlipper {\n }\n }\n }\n-}\n\\ No newline at end of file\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\nindex 0cad655b33..6536fc03ad 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n@@ -1,4 +1,4 @@\n-\n+\n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 8e13797d9b..7e2823fb6c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -29,15 +30,20 @@ public class MainActivity extends ReactActivity {\n }\n \n /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled\n+ // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).\n+ DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled\n+ ));\n }\n \n /**\n@@ -59,25 +65,4 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..31c2b288c1 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,70 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \"index\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +73,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\ndeleted file mode 100644\nindex d2cad3a326..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-cmake_minimum_required(VERSION 3.13)\n-\n-# Define the library name here.\n-project(helloworld_appmodules)\n-\n-# This file includes all the necessary to let you build your application with the New Architecture.\n-include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 26162dd872..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n-\n- // Module providers autolinked by RN CLI\n- auto rncli_module = rncli_ModuleProvider(moduleName, params);\n- if (rncli_module != nullptr) {\n- return rncli_module;\n- }\n-\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex b38ccf53fd..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex 5fd688c509..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- const std::string &name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 9ee38a81f6..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(const std::string &name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 54f598a486..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,65 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Autolinked providers registered by RN CLI\n- rncli_registerProviders(providerRegistry);\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\nnew file mode 100644\nindex 0000000000..b510364404\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/release/java/com/helloworld/ReactNativeFlipper.java\n@@ -0,0 +1,20 @@\n+/**\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n+ *\n+ *

This source code is licensed under the MIT license found in the LICENSE file in the root\n+ * directory of this source tree.\n+ */\n+package com.helloworld;\n+\n+import android.content.Context;\n+import com.facebook.react.ReactInstanceManager;\n+\n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the release\n+ * flavor of it so it's empty as we don't want to load Flipper.\n+ */\n+public class ReactNativeFlipper {\n+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n+ // Do nothing as we don't want to initialize Flipper on Release.\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/build.gradle b/templates/expo-template-bare-minimum/android/build.gradle\nindex 8181b282cd..e5fda82878 100644\n--- a/templates/expo-template-bare-minimum/android/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/build.gradle\n@@ -2,47 +2,30 @@\n \n buildscript {\n ext {\n- buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'\n+ buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0'\n minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')\n- compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')\n- targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')\n+ compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33')\n+ targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33')\n if (findProperty('android.kotlinVersion')) {\n kotlinVersion = findProperty('android.kotlinVersion')\n }\n frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'\n \n- if (System.properties['os.arch'] == 'aarch64') {\n- // For M1 Users we need to use the NDK 24 which added support for aarch64\n- ndkVersion = '24.0.8215888'\n- } else {\n- // Otherwise we default to the side-by-side NDK version from AGP.\n- ndkVersion = '21.4.7075529'\n- }\n+ // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.\n+ ndkVersion = \"23.1.7779620\"\n }\n repositories {\n google()\n mavenCentral()\n }\n dependencies {\n- classpath('com.android.tools.build:gradle:7.2.1')\n+ classpath('com.android.tools.build:gradle:7.4.1')\n classpath('com.facebook.react:react-native-gradle-plugin')\n- classpath('de.undercouch:gradle-download-task:5.0.1')\n- // NOTE: Do not place your application dependencies here; they belong\n- // in the individual module build.gradle files\n }\n }\n \n-def REACT_NATIVE_VERSION = new File(['node', '--print', \"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version\"].execute(null, rootDir).text.trim())\n-\n allprojects {\n- configurations.all {\n- resolutionStrategy {\n- force \"com.facebook.react:react-native:\" + REACT_NATIVE_VERSION\n- }\n- }\n-\n repositories {\n- mavenLocal()\n maven {\n // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm\n url(new File(['node', '--print', \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), '../android'))\n@@ -53,13 +36,7 @@ allprojects {\n }\n \n google()\n- mavenCentral {\n- // We don't want to fetch react-native from Maven Central as there are\n- // older versions over there.\n- content {\n- excludeGroup 'com.facebook.react'\n- }\n- }\n+ mavenCentral()\n maven { url 'https://www.jitpack.io' }\n }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/gitignore b/templates/expo-template-bare-minimum/android/gitignore\nindex 64436baaf5..877b87e9a5 100644\n--- a/templates/expo-template-bare-minimum/android/gitignore\n+++ b/templates/expo-template-bare-minimum/android/gitignore\n@@ -11,11 +11,5 @@ local.properties\n *.iml\n *.hprof\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\ndiff --git a/templates/expo-template-bare-minimum/android/gradle.properties b/templates/expo-template-bare-minimum/android/gradle.properties\nindex fab3fb6bcf..9911ac4afd 100644\n--- a/templates/expo-template-bare-minimum/android/gradle.properties\n+++ b/templates/expo-template-bare-minimum/android/gradle.properties\n@@ -42,7 +42,7 @@ newArchEnabled=false\n \n # The hosted JavaScript engine\n # Supported values: expo.jsEngine = \"hermes\" | \"jsc\"\n-expo.jsEngine=jsc\n+expo.jsEngine=hermes\n \n # Enable GIF support in React Native images (~200 B increase)\n expo.gif.enabled=true\ndiff --git a/templates/expo-template-bare-minimum/android/settings.gradle b/templates/expo-template-bare-minimum/android/settings.gradle\nindex b3332319f9..1dc416e7c1 100644\n--- a/templates/expo-template-bare-minimum/android/settings.gradle\n+++ b/templates/expo-template-bare-minimum/android/settings.gradle\n@@ -8,10 +8,3 @@ applyNativeModulesSettingsGradle(settings)\n \n include ':app'\n includeBuild(new File([\"node\", \"--print\", \"require.resolve('react-native-gradle-plugin/package.json')\"].execute(null, rootDir).text.trim()).getParentFile())\n-\n-if (settings.hasProperty(\"newArchEnabled\") && settings.newArchEnabled == \"true\") {\n- include(\":ReactAndroid\")\n- project(\":ReactAndroid\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid\");\n- include(\":ReactAndroid:hermes-engine\")\n- project(\":ReactAndroid:hermes-engine\").projectDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../ReactAndroid/hermes-engine\");\n-}\ndiff --git a/templates/expo-template-bare-minimum/gitignore b/templates/expo-template-bare-minimum/gitignore\nindex 67397f65f9..df57ba88a1 100644\n--- a/templates/expo-template-bare-minimum/gitignore\n+++ b/templates/expo-template-bare-minimum/gitignore\n@@ -31,6 +31,8 @@ local.properties\n *.iml\n *.hprof\n .cxx/\n+*.keystore\n+!debug.keystore\n \n # node.js\n #\n@@ -38,18 +40,15 @@ node_modules/\n npm-debug.log\n yarn-error.log\n \n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n # Bundle artifacts\n *.jsbundle\n \n # CocoaPods\n /ios/Pods/\n \n+# Temporary files created by Metro to check the health of the file watcher\n+.metro-health-check*\n+\n # Expo\n .expo/\n web-build/\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\nindex 62a1be2493..98e6c2afea 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj\n@@ -310,6 +310,7 @@\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n \t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\n@@ -333,6 +334,7 @@\n \t\t\t\tINFOPLIST_FILE = HelloWorld/Info.plist;\n \t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 13.0;\n \t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n+ MARKETING_VERSION = 1.0;\n \t\t\t\tOTHER_LDFLAGS = (\n \t\t\t\t\t\"$(inherited)\",\n \t\t\t\t\t\"-ObjC\",\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\nindex f7d2972042..1658a437eb 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.h\n@@ -1,9 +1,7 @@\n-#import \n-#import \n+#import \n #import \n-\n #import \n \n-@interface AppDelegate : EXAppDelegateWrapper \n+@interface AppDelegate : EXAppDelegateWrapper\n \n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\nindex a6e13e11ab..8cb5aef137 100644\n--- a/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n+++ b/templates/expo-template-bare-minimum/ios/HelloWorld/AppDelegate.mm\n@@ -1,100 +1,40 @@\n #import \"AppDelegate.h\"\n \n-#import \n #import \n-#import \n #import \n-#import \n-\n-#import \n-\n-#if RCT_NEW_ARCH_ENABLED\n-#import \n-#import \n-#import \n-#import \n-#import \n-#import \n-\n-#import \n-\n-static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n-\n-@interface AppDelegate () {\n- RCTTurboModuleManager *_turboModuleManager;\n- RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;\n- std::shared_ptr _reactNativeConfig;\n- facebook::react::ContextContainer::Shared _contextContainer;\n-}\n-@end\n-#endif\n \n @implementation AppDelegate\n \n - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n {\n- RCTAppSetupPrepareApp(application);\n-\n- RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];\n-\n-#if RCT_NEW_ARCH_ENABLED\n- _contextContainer = std::make_shared();\n- _reactNativeConfig = std::make_shared();\n- _contextContainer->insert(\"ReactNativeConfig\", _reactNativeConfig);\n- _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];\n- bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;\n-#endif\n-\n- NSDictionary *initProps = [self prepareInitialProps];\n- UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@\"main\" initialProperties:initProps];\n-\n- rootView.backgroundColor = [UIColor whiteColor];\n- self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n- UIViewController *rootViewController = [self.reactDelegate createRootViewController];\n- rootViewController.view = rootView;\n- self.window.rootViewController = rootViewController;\n- [self.window makeKeyAndVisible];\n+ self.moduleName = @\"main\";\n \n- [super application:application didFinishLaunchingWithOptions:launchOptions];\n+ // You can add your custom initial props in the dictionary below.\n+ // They will be passed down to the ViewController used by React Native.\n+ self.initialProps = @{};\n \n- return YES;\n+ return [super application:application didFinishLaunchingWithOptions:launchOptions];\n }\n \n-- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge\n+- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n {\n- // If you'd like to export some custom RCTBridgeModules, add them here!\n- return @[];\n+#if DEBUG\n+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n+#else\n+ return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n+#endif\n }\n \n /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.\n ///\n /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html\n /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).\n-/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.\n+/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.\n - (BOOL)concurrentRootEnabled\n {\n- // Switch this bool to turn on and off the concurrent root\n return true;\n }\n \n-- (NSDictionary *)prepareInitialProps\n-{\n- NSMutableDictionary *initProps = [NSMutableDictionary new];\n-#if RCT_NEW_ARCH_ENABLED\n- initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);\n-#endif\n- return initProps;\n-}\n-\n-- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge\n-{\n-#if DEBUG\n- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\"];\n-#else\n- return [[NSBundle mainBundle] URLForResource:@\"main\" withExtension:@\"jsbundle\"];\n-#endif\n-}\n-\n // Linking API\n - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options {\n return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];\n@@ -124,43 +64,4 @@ static NSString *const kRNConcurrentRoot = @\"concurrentRoot\";\n return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];\n }\n \n-#if RCT_NEW_ARCH_ENABLED\n-\n-#pragma mark - RCTCxxBridgeDelegate\n-\n-- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge\n-{\n- _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge\n- delegate:self\n- jsInvoker:bridge.jsCallInvoker];\n- return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);\n-}\n-\n-#pragma mark RCTTurboModuleManagerDelegate\n-\n-- (Class)getModuleClassFromName:(const char *)name\n-{\n- return RCTCoreModulesClassProvider(name);\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- jsInvoker:(std::shared_ptr)jsInvoker\n-{\n- return nullptr;\n-}\n-\n-- (std::shared_ptr)getTurboModule:(const std::string &)name\n- initParams:\n- (const facebook::react::ObjCTurboModule::InitParams &)params\n-{\n- return nullptr;\n-}\n-\n-- (id)getModuleInstanceFromClass:(Class)moduleClass\n-{\n- return RCTAppSetupDefaultModuleFromClass(moduleClass);\n-}\n-\n-#endif\n-\n @end\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile b/templates/expo-template-bare-minimum/ios/Podfile\nindex 474455b90d..e523ea5cac 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile\n+++ b/templates/expo-template-bare-minimum/ios/Podfile\n@@ -5,34 +5,63 @@ require File.join(File.dirname(`node --print \"require.resolve('@react-native-com\n require 'json'\n podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}\n \n+ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'\n+ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = '1' if podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] == 'true'\n+\n platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'\n install! 'cocoapods',\n :deterministic_uuids => false\n \n+prepare_react_native_project!\n+\n+# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.\n+# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,\n+# you can also exclude `react-native-flipper` in `react-native.config.js`\n+#\n+# ```js\n+# module.exports = {\n+# dependencies: {\n+# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),\n+# }\n+# }\n+# ```\n+flipper_config = FlipperConfiguration.disabled\n+if ENV['NO_FLIPPER'] == '1' then\n+ # Explicitly disabled through environment variables\n+ flipper_config = FlipperConfiguration.disabled\n+elsif podfile_properties.key?('ios.flipper') then\n+ # Configure Flipper in Podfile.properties.json\n+ if podfile_properties['ios.flipper'] == 'true' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"])\n+ elsif podfile_properties['ios.flipper'] != 'false' then\n+ flipper_config = FlipperConfiguration.enabled([\"Debug\", \"Release\"], { 'Flipper' => podfile_properties['ios.flipper'] })\n+ end\n+end\n+\n target 'HelloWorld' do\n use_expo_modules!\n config = use_native_modules!\n \n use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']\n+ use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']\n \n # Flags change depending on the env values.\n flags = get_default_flags()\n \n use_react_native!(\n :path => config[:reactNativePath],\n- :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes',\n+ :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',\n :fabric_enabled => flags[:fabric_enabled],\n # An absolute path to your application root.\n :app_path => \"#{Pod::Config.instance.installation_root}/..\",\n- #\n- # Uncomment to opt-in to using Flipper\n- # Note that if you have use_frameworks! enabled, Flipper will not work\n- # :flipper_configuration => !ENV['CI'] ? FlipperConfiguration.enabled : FlipperConfiguration.disabled,\n+ # Note that if you have use_frameworks! enabled, Flipper will not work if enabled\n+ :flipper_configuration => flipper_config\n )\n \n post_install do |installer|\n react_native_post_install(\n installer,\n+ config[:reactNativePath],\n # Set `mac_catalyst_enabled` to `true` in order to apply patches\n # necessary for Mac Catalyst builds\n :mac_catalyst_enabled => false\ndiff --git a/templates/expo-template-bare-minimum/ios/Podfile.properties.json b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\nindex f6d872e81a..b1bd45da51 100644\n--- a/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n+++ b/templates/expo-template-bare-minimum/ios/Podfile.properties.json\n@@ -1,3 +1,3 @@\n {\n- \"expo.jsEngine\": \"jsc\"\n+ \"expo.jsEngine\": \"hermes\"\n }\ndiff --git a/templates/expo-template-bare-minimum/package.json b/templates/expo-template-bare-minimum/package.json\nindex a41fdc0d8d..d1fcd513cc 100644\n--- a/templates/expo-template-bare-minimum/package.json\n+++ b/templates/expo-template-bare-minimum/package.json\n@@ -1,7 +1,7 @@\n {\n \"name\": \"expo-template-bare-minimum\",\n \"description\": \"This bare project template includes a minimal setup for using unimodules with React Native.\",\n- \"version\": \"47.0.26\",\n+ \"version\": \"48.0.21\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"start\": \"expo start --dev-client\",\n@@ -10,13 +10,13 @@\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n- \"expo\": \"~47.0.14\",\n- \"expo-splash-screen\": \"~0.17.5\",\n- \"expo-status-bar\": \"~1.4.2\",\n- \"react\": \"18.1.0\",\n- \"react-native\": \"0.70.8\"\n+ \"expo\": \"~48.0.21\",\n+ \"expo-splash-screen\": \"~0.18.2\",\n+ \"expo-status-bar\": \"~1.4.4\",\n+ \"react\": \"18.2.0\",\n+ \"react-native\": \"0.71.14\"\n },\n \"devDependencies\": {\n- \"@babel/core\": \"^7.12.9\"\n+ \"@babel/core\": \"^7.20.0\"\n }\n }\n","48..48":"","45..49":"diff --git a/templates/expo-template-bare-minimum/.buckconfig b/templates/expo-template-bare-minimum/.buckconfig\ndeleted file mode 100644\nindex 934256cb29..0000000000\n--- a/templates/expo-template-bare-minimum/.buckconfig\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-\n-[android]\n- target = Google Inc.:Google APIs:23\n-\n-[maven_repositories]\n- central = https://repo1.maven.org/maven2\ndiff --git a/templates/expo-template-bare-minimum/.npmignore b/templates/expo-template-bare-minimum/.npmignore\nindex 35490b6612..bc0b76356d 100644\n--- a/templates/expo-template-bare-minimum/.npmignore\n+++ b/templates/expo-template-bare-minimum/.npmignore\n@@ -17,6 +17,8 @@ web-build/\n HelloWorld.xcworkspace\n Podfile.lock\n ios/Pods\n+ios/.xcode.env.local\n android/.build\n android/app/build\n android/.gradle\n+ios/.xcode.env.local\ndiff --git a/templates/expo-template-bare-minimum/android/app/BUCK b/templates/expo-template-bare-minimum/android/app/BUCK\ndeleted file mode 100644\nindex 0e77904834..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/BUCK\n+++ /dev/null\n@@ -1,55 +0,0 @@\n-# To learn about Buck see [Docs](https://buckbuild.com/).\n-# To run your application with Buck:\n-# - install Buck\n-# - `npm start` - to start the packager\n-# - `cd android`\n-# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname \"CN=Android Debug,O=Android,C=US\"`\n-# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck\n-# - `buck install -r android/app` - compile, install and run application\n-#\n-\n-load(\":build_defs.bzl\", \"create_aar_targets\", \"create_jar_targets\")\n-\n-lib_deps = []\n-\n-create_aar_targets(glob([\"libs/*.aar\"]))\n-\n-create_jar_targets(glob([\"libs/*.jar\"]))\n-\n-android_library(\n- name = \"all-libs\",\n- exported_deps = lib_deps,\n-)\n-\n-android_library(\n- name = \"app-code\",\n- srcs = glob([\n- \"src/main/java/**/*.java\",\n- ]),\n- deps = [\n- \":all-libs\",\n- \":build_config\",\n- \":res\",\n- ],\n-)\n-\n-android_build_config(\n- name = \"build_config\",\n- package = \"com.helloworld\",\n-)\n-\n-android_resource(\n- name = \"res\",\n- package = \"com.helloworld\",\n- res = \"src/main/res\",\n-)\n-\n-android_binary(\n- name = \"app\",\n- keystore = \"//android/keystores:debug\",\n- manifest = \"src/main/AndroidManifest.xml\",\n- package_type = \"debug\",\n- deps = [\n- \":app-code\",\n- ],\n-)\ndiff --git a/templates/expo-template-bare-minimum/android/app/build.gradle b/templates/expo-template-bare-minimum/android/app/build.gradle\nindex 346fb02564..7105aaaa3f 100644\n--- a/templates/expo-template-bare-minimum/android/app/build.gradle\n+++ b/templates/expo-template-bare-minimum/android/app/build.gradle\n@@ -1,232 +1,95 @@\n apply plugin: \"com.android.application\"\n-\n-import com.android.build.OutputFile\n-import org.apache.tools.ant.taskdefs.condition.Os\n-\n-/**\n- * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets\n- * and bundleReleaseJsAndAssets).\n- * These basically call `react-native bundle` with the correct arguments during the Android build\n- * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the\n- * bundle directly from the development server. Below you can see all the possible configurations\n- * and their defaults. If you decide to add a configuration block, make sure to add it before the\n- * `apply from: \"../../node_modules/react-native/react.gradle\"` line.\n- *\n- * project.ext.react = [\n- * // the name of the generated asset file containing your JS bundle\n- * bundleAssetName: \"index.android.bundle\",\n- *\n- * // the entry file for bundle generation. If none specified and\n- * // \"index.android.js\" exists, it will be used. Otherwise \"index.js\" is\n- * // default. Can be overridden with ENTRY_FILE environment variable.\n- * entryFile: \"index.android.js\",\n- *\n- * // https://reactnative.dev/docs/performance#enable-the-ram-format\n- * bundleCommand: \"ram-bundle\",\n- *\n- * // whether to bundle JS and assets in debug mode\n- * bundleInDebug: false,\n- *\n- * // whether to bundle JS and assets in release mode\n- * bundleInRelease: true,\n- *\n- * // whether to bundle JS and assets in another build variant (if configured).\n- * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants\n- * // The configuration property can be in the following formats\n- * // 'bundleIn${productFlavor}${buildType}'\n- * // 'bundleIn${buildType}'\n- * // bundleInFreeDebug: true,\n- * // bundleInPaidRelease: true,\n- * // bundleInBeta: true,\n- *\n- * // whether to disable dev mode in custom build variants (by default only disabled in release)\n- * // for example: to disable dev mode in the staging build type (if configured)\n- * devDisabledInStaging: true,\n- * // The configuration property can be in the following formats\n- * // 'devDisabledIn${productFlavor}${buildType}'\n- * // 'devDisabledIn${buildType}'\n- *\n- * // the root of your project, i.e. where \"package.json\" lives\n- * root: \"../../\",\n- *\n- * // where to put the JS bundle asset in debug mode\n- * jsBundleDirDebug: \"$buildDir/intermediates/assets/debug\",\n- *\n- * // where to put the JS bundle asset in release mode\n- * jsBundleDirRelease: \"$buildDir/intermediates/assets/release\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in debug mode\n- * resourcesDirDebug: \"$buildDir/intermediates/res/merged/debug\",\n- *\n- * // where to put drawable resources / React Native assets, e.g. the ones you use via\n- * // require('./image.png')), in release mode\n- * resourcesDirRelease: \"$buildDir/intermediates/res/merged/release\",\n- *\n- * // by default the gradle tasks are skipped if none of the JS files or assets change; this means\n- * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to\n- * // date; if you have any other folders that you want to ignore for performance reasons (gradle\n- * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/\n- * // for example, you might want to remove it from here.\n- * inputExcludes: [\"android/**\", \"ios/**\"],\n- *\n- * // override which node gets called and with what additional arguments\n- * nodeExecutableAndArgs: [\"node\"],\n- *\n- * // supply additional arguments to the packager\n- * extraPackagerArgs: []\n- * ]\n- */\n+apply plugin: \"com.facebook.react\"\n \n def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()\n \n-project.ext.react = [\n- entryFile: [\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\"].execute(null, rootDir).text.trim(),\n- enableHermes: (findProperty('expo.jsEngine') ?: \"jsc\") == \"hermes\",\n- cliPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/cli.js\",\n- hermesCommand: new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/%OS-BIN%/hermesc\",\n- composeSourceMapsPath: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/scripts/compose-source-maps.js\",\n-]\n-\n-apply from: new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim(), \"../react.gradle\")\n-\n /**\n- * Set this to true to create two separate APKs instead of one:\n- * - An APK that only works on ARM devices\n- * - An APK that only works on x86 devices\n- * The advantage is the size of the APK is reduced by about 4MB.\n- * Upload all the APKs to the Play Store and people will download\n- * the correct one based on the CPU architecture of their device.\n+ * This is the configuration block to customize your React Native Android app.\n+ * By default you don't need to apply any configuration, just uncomment the lines you need.\n */\n-def enableSeparateBuildPerCPUArchitecture = false\n+react {\n+ entryFile = file([\"node\", \"-e\", \"require('expo/scripts/resolveAppEntry')\", projectRoot, \"android\", \"absolute\"].execute(null, rootDir).text.trim())\n+ reactNativeDir = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()\n+ hermesCommand = new File([\"node\", \"--print\", \"require.resolve('react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/sdks/hermesc/%OS-BIN%/hermesc\"\n+ codegenDir = new File([\"node\", \"--print\", \"require.resolve('@react-native/codegen/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()\n+\n+ // Use Expo CLI to bundle the app, this ensures the Metro config\n+ // works correctly with Expo projects.\n+ cliFile = new File([\"node\", \"--print\", \"require.resolve('@expo/cli')\"].execute(null, rootDir).text.trim())\n+ bundleCommand = \"export:embed\"\n+\n+ /* Folders */\n+ // The root of your project, i.e. where \"package.json\" lives. Default is '..'\n+ // root = file(\"../\")\n+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native\n+ // reactNativeDir = file(\"../node_modules/react-native\")\n+ // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen\n+ // codegenDir = file(\"../node_modules/@react-native/codegen\")\n+\n+ /* Variants */\n+ // The list of variants to that are debuggable. For those we're going to\n+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.\n+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.\n+ // debuggableVariants = [\"liteDebug\", \"prodDebug\"]\n+\n+ /* Bundling */\n+ // A list containing the node command and its flags. Default is just 'node'.\n+ // nodeExecutableAndArgs = [\"node\"]\n+\n+ //\n+ // The path to the CLI configuration file. Default is empty.\n+ // bundleConfig = file(../rn-cli.config.js)\n+ //\n+ // The name of the generated asset file containing your JS bundle\n+ // bundleAssetName = \"MyApplication.android.bundle\"\n+ //\n+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'\n+ // entryFile = file(\"../js/MyApplication.android.js\")\n+ //\n+ // A list of extra flags to pass to the 'bundle' commands.\n+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle\n+ // extraPackagerArgs = []\n+\n+ /* Hermes Commands */\n+ // The hermes compiler command to run. By default it is 'hermesc'\n+ // hermesCommand = \"$rootDir/my-custom-hermesc/bin/hermesc\"\n+ //\n+ // The list of flags to pass to the Hermes compiler. By default is \"-O\", \"-output-source-map\"\n+ // hermesFlags = [\"-O\", \"-output-source-map\"]\n+}\n \n /**\n- * Run Proguard to shrink the Java bytecode in release builds.\n+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.\n */\n def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()\n \n /**\n- * The preferred build flavor of JavaScriptCore.\n+ * The preferred build flavor of JavaScriptCore (JSC)\n *\n * For example, to use the international variant, you can use:\n * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`\n *\n * The international variant includes ICU i18n library and necessary data\n * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that\n- * give correct results when using with locales other than en-US. Note that\n+ * give correct results when using with locales other than en-US. Note that\n * this variant is about 6MiB larger per architecture than default.\n */\n def jscFlavor = 'org.webkit:android-jsc:+'\n \n-/**\n- * Whether to enable the Hermes VM.\n- *\n- * This should be set on project.ext.react and that value will be read here. If it is not set\n- * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode\n- * and the benefits of using Hermes will therefore be sharply reduced.\n- */\n-def enableHermes = project.ext.react.get(\"enableHermes\", false);\n-\n-/**\n- * Architectures to build native code for.\n- */\n-def reactNativeArchitectures() {\n- def value = project.getProperties().get(\"reactNativeArchitectures\")\n- return value ? value.split(\",\") : [\"armeabi-v7a\", \"x86\", \"x86_64\", \"arm64-v8a\"]\n-}\n-\n android {\n ndkVersion rootProject.ext.ndkVersion\n \n compileSdkVersion rootProject.ext.compileSdkVersion\n \n+ namespace \"com.helloworld\"\n defaultConfig {\n applicationId \"com.helloworld\"\n minSdkVersion rootProject.ext.minSdkVersion\n targetSdkVersion rootProject.ext.targetSdkVersion\n versionCode 1\n versionName \"1.0\"\n- buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- arguments \"APP_PLATFORM=android-21\",\n- \"APP_STL=c++_shared\",\n- \"NDK_TOOLCHAIN_VERSION=clang\",\n- \"GENERATED_SRC_DIR=$buildDir/generated/source\",\n- \"PROJECT_BUILD_DIR=$buildDir\",\n- \"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid\",\n- \"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build\"\n- cFlags \"-Wall\", \"-Werror\", \"-fexceptions\", \"-frtti\", \"-DWITH_INSPECTOR=1\"\n- cppFlags \"-std=c++17\"\n- // Make sure this target name is the same you specify inside the\n- // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.\n- targets \"helloworld_appmodules\"\n-\n- // Fix for windows limit on number of character in file paths and in command lines\n- if (Os.isFamily(Os.FAMILY_WINDOWS)) {\n- arguments \"NDK_APP_SHORT_COMMANDS=true\"\n- }\n- }\n- }\n- if (!enableSeparateBuildPerCPUArchitecture) {\n- ndk {\n- abiFilters (*reactNativeArchitectures())\n- }\n- }\n- }\n- }\n-\n- if (isNewArchitectureEnabled()) {\n- // We configure the NDK build only if you decide to opt-in for the New Architecture.\n- externalNativeBuild {\n- ndkBuild {\n- path \"$projectDir/src/main/jni/Android.mk\"\n- }\n- }\n- def reactAndroidProjectDir = project(':ReactAndroid').projectDir\n- def packageReactNdkDebugLibs = tasks.register(\"packageReactNdkDebugLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkDebugLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- def packageReactNdkReleaseLibs = tasks.register(\"packageReactNdkReleaseLibs\", Copy) {\n- dependsOn(\":ReactAndroid:packageReactNdkReleaseLibsForBuck\")\n- from(\"$reactAndroidProjectDir/src/main/jni/prebuilt/lib\")\n- into(\"$buildDir/react-ndk/exported\")\n- }\n- afterEvaluate {\n- // If you wish to add a custom TurboModule or component locally,\n- // you should uncomment this line.\n- // preBuild.dependsOn(\"generateCodegenArtifactsFromSchema\")\n- preDebugBuild.dependsOn(packageReactNdkDebugLibs)\n- preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)\n \n- // Due to a bug inside AGP, we have to explicitly set a dependency\n- // between configureNdkBuild* tasks and the preBuild tasks.\n- // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732\n- configureNdkBuildRelease.dependsOn(preReleaseBuild)\n- configureNdkBuildDebug.dependsOn(preDebugBuild)\n- reactNativeArchitectures().each { architecture ->\n- tasks.findByName(\"configureNdkBuildDebug[${architecture}]\")?.configure {\n- dependsOn(\"preDebugBuild\")\n- }\n- tasks.findByName(\"configureNdkBuildRelease[${architecture}]\")?.configure {\n- dependsOn(\"preReleaseBuild\")\n- }\n- }\n- }\n- }\n-\n- splits {\n- abi {\n- reset()\n- enable enableSeparateBuildPerCPUArchitecture\n- universalApk false // If true, also generate a universal APK\n- include (*reactNativeArchitectures())\n- }\n+ buildConfigField(\"boolean\", \"REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS\", (findProperty(\"reactNative.unstable_useRuntimeSchedulerAlways\") ?: true).toString())\n }\n signingConfigs {\n debug {\n@@ -244,25 +107,11 @@ android {\n // Caution! In production, you need to generate your own keystore file.\n // see https://reactnative.dev/docs/signed-apk-android.\n signingConfig signingConfigs.debug\n+ shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)\n minifyEnabled enableProguardInReleaseBuilds\n proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n }\n }\n-\n- // applicationVariants are e.g. debug, release\n- applicationVariants.all { variant ->\n- variant.outputs.each { output ->\n- // For each separate APK per architecture, set a unique version code as described here:\n- // https://developer.android.com/studio/build/configure-apk-splits.html\n- def versionCodes = [\"armeabi-v7a\": 1, \"x86\": 2, \"arm64-v8a\": 3, \"x86_64\": 4]\n- def abi = output.getFilter(OutputFile.ABI)\n- if (abi != null) { // null for the universal-debug, universal-release variants\n- output.versionCodeOverride =\n- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode\n- }\n-\n- }\n- }\n }\n \n // Apply static values from `gradle.properties` to the `android.packagingOptions`\n@@ -286,10 +135,8 @@ android {\n }\n \n dependencies {\n- implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n-\n- //noinspection GradleDynamicVersion\n- implementation \"com.facebook.react:react-native:+\" // From node_modules\n+ // The version of react-native is set by the React Native Gradle Plugin\n+ implementation(\"com.facebook.react:react-android\")\n \n def isGifEnabled = (findProperty('expo.gif.enabled') ?: \"\") == \"true\";\n def isWebpEnabled = (findProperty('expo.webp.enabled') ?: \"\") == \"true\";\n@@ -298,70 +145,36 @@ dependencies {\n \n // If your app supports Android versions before Ice Cream Sandwich (API level 14)\n if (isGifEnabled || isWebpEnabled) {\n- implementation \"com.facebook.fresco:fresco:${frescoVersion}\"\n- implementation \"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:fresco:${frescoVersion}\")\n+ implementation(\"com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}\")\n }\n \n if (isGifEnabled) {\n // For animated gif support\n- implementation \"com.facebook.fresco:animated-gif:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-gif:${frescoVersion}\")\n }\n \n if (isWebpEnabled) {\n // For webp support\n- implementation \"com.facebook.fresco:webpsupport:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:webpsupport:${frescoVersion}\")\n if (isWebpAnimatedEnabled) {\n // Animated webp support\n- implementation \"com.facebook.fresco:animated-webp:${frescoVersion}\"\n+ implementation(\"com.facebook.fresco:animated-webp:${frescoVersion}\")\n }\n }\n \n- implementation \"androidx.swiperefreshlayout:swiperefreshlayout:1.0.0\"\n- debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.fbjni'\n- }\n+ debugImplementation(\"com.facebook.flipper:flipper:${FLIPPER_VERSION}\")\n debugImplementation(\"com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n exclude group:'com.squareup.okhttp3', module:'okhttp'\n }\n- debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\") {\n- exclude group:'com.facebook.flipper'\n- }\n+ debugImplementation(\"com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}\")\n \n- if (enableHermes) {\n- debugImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-debug.aar\"))\n- releaseImplementation files(new File([\"node\", \"--print\", \"require.resolve('hermes-engine/package.json')\"].execute(null, rootDir).text.trim(), \"../android/hermes-release.aar\"))\n+ if (hermesEnabled.toBoolean()) {\n+ implementation(\"com.facebook.react:hermes-android\")\n } else {\n implementation jscFlavor\n }\n }\n \n-if (isNewArchitectureEnabled()) {\n- // If new architecture is enabled, we let you build RN from source\n- // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.\n- // This will be applied to all the imported transtitive dependency.\n- configurations.all {\n- resolutionStrategy.dependencySubstitution {\n- substitute(module(\"com.facebook.react:react-native\"))\n- .using(project(\":ReactAndroid\")).because(\"On New Architecture we're building React Native from source\")\n- }\n- }\n-}\n-\n-// Run this once to be able to run the application with BUCK\n-// puts all compile dependencies into folder libs for BUCK to use\n-task copyDownloadableDepsToLibs(type: Copy) {\n- from configurations.implementation\n- into 'libs'\n-}\n-\n apply from: new File([\"node\", \"--print\", \"require.resolve('@react-native-community/cli-platform-android/package.json')\"].execute(null, rootDir).text.trim(), \"../native_modules.gradle\");\n applyNativeModulesAppBuildGradle(project)\n-\n-def isNewArchitectureEnabled() {\n- // To opt-in for the New Architecture, you can either:\n- // - Set `newArchEnabled` to true inside the `gradle.properties` file\n- // - Invoke gradle with `-newArchEnabled=true`\n- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`\n- return project.hasProperty(\"newArchEnabled\") && project.newArchEnabled == \"true\"\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/build_defs.bzl b/templates/expo-template-bare-minimum/android/app/build_defs.bzl\ndeleted file mode 100644\nindex fff270f8d1..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/build_defs.bzl\n+++ /dev/null\n@@ -1,19 +0,0 @@\n-\"\"\"Helper definitions to glob .aar and .jar targets\"\"\"\n-\n-def create_aar_targets(aarfiles):\n- for aarfile in aarfiles:\n- name = \"aars__\" + aarfile[aarfile.rindex(\"/\") + 1:aarfile.rindex(\".aar\")]\n- lib_deps.append(\":\" + name)\n- android_prebuilt_aar(\n- name = name,\n- aar = aarfile,\n- )\n-\n-def create_jar_targets(jarfiles):\n- for jarfile in jarfiles:\n- name = \"jars__\" + jarfile[jarfile.rindex(\"/\") + 1:jarfile.rindex(\".jar\")]\n- lib_deps.append(\":\" + name)\n- prebuilt_jar(\n- name = name,\n- binary_jar = jarfile,\n- )\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/debug/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/debug/AndroidManifest.xml\nindex 99e38fc5f8..3ec2507bab 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/debug/AndroidManifest.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/debug/AndroidManifest.xml\n@@ -3,5 +3,5 @@\n \n \n \n- \n+ \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\nindex 8cddb11cb2..595dd5831c 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/debug/java/com/helloworld/ReactNativeFlipper.java\n@@ -1,5 +1,5 @@\n /**\n- * Copyright (c) Facebook, Inc. and its affiliates.\n+ * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *

This source code is licensed under the MIT license found in the LICENSE file in the root\n * directory of this source tree.\n@@ -17,22 +17,27 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping;\n import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;\n import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;\n import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;\n-import com.facebook.flipper.plugins.react.ReactFlipperPlugin;\n import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;\n+import com.facebook.react.ReactInstanceEventListener;\n import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.bridge.ReactContext;\n import com.facebook.react.modules.network.NetworkingModule;\n import okhttp3.OkHttpClient;\n \n+/**\n+ * Class responsible of loading Flipper inside your React Native application. This is the debug\n+ * flavor of it. Here you can add your own plugins and customize the Flipper setup.\n+ */\n public class ReactNativeFlipper {\n public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {\n if (FlipperUtils.shouldEnableFlipper(context)) {\n final FlipperClient client = AndroidFlipperClient.getInstance(context);\n+\n client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));\n- client.addPlugin(new ReactFlipperPlugin());\n client.addPlugin(new DatabasesFlipperPlugin(context));\n client.addPlugin(new SharedPreferencesFlipperPlugin(context));\n client.addPlugin(CrashReporterPlugin.getInstance());\n+\n NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();\n NetworkingModule.setCustomClientBuilder(\n new NetworkingModule.CustomClientBuilder() {\n@@ -43,12 +48,13 @@ public class ReactNativeFlipper {\n });\n client.addPlugin(networkFlipperPlugin);\n client.start();\n+\n // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized\n // Hence we run if after all native modules have been initialized\n ReactContext reactContext = reactInstanceManager.getCurrentReactContext();\n if (reactContext == null) {\n reactInstanceManager.addReactInstanceEventListener(\n- new ReactInstanceManager.ReactInstanceEventListener() {\n+ new ReactInstanceEventListener() {\n @Override\n public void onReactContextInitialized(ReactContext reactContext) {\n reactInstanceManager.removeReactInstanceEventListener(this);\n@@ -66,4 +72,4 @@ public class ReactNativeFlipper {\n }\n }\n }\n-}\n\\ No newline at end of file\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\nindex 0cad655b33..34a7ca8314 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml\n@@ -1,4 +1,4 @@\n-\n+\n \n \n \n@@ -18,7 +18,7 @@\n \n \n \n- \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 576e23db45..176fbf6a2a 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -28,11 +29,18 @@ public class MainActivity extends ReactActivity {\n return \"main\";\n }\n \n+ /**\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n+ */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled()));\n }\n \n /**\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..e7f376902d 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,76 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \".expo/.virtual-metro-entry\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false;\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ }\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +79,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex f555e36448..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,116 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- new EmptyReactNativeConfig(),\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex 0ae6366756..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,49 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,7 +18,7 @@\n \n \n \n- \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 8e13797d9b..176fbf6a2a 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -29,15 +30,17 @@ public class MainActivity extends ReactActivity {\n }\n \n /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled()));\n }\n \n /**\n@@ -59,25 +62,4 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..e7f376902d 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,76 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \".expo/.virtual-metro-entry\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false;\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ }\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +79,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex cda1391225..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source\n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_runtime \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,7 +18,7 @@\n \n \n \n- \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\nindex 8e13797d9b..176fbf6a2a 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n@@ -5,7 +5,8 @@ import android.os.Bundle;\n \n import com.facebook.react.ReactActivity;\n import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactActivityDelegate;\n \n import expo.modules.ReactActivityDelegateWrapper;\n \n@@ -29,15 +30,17 @@ public class MainActivity extends ReactActivity {\n }\n \n /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link\n+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React\n+ * (aka React 18) with two boolean flags.\n */\n @Override\n protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n+ return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(\n+ this,\n+ getMainComponentName(),\n+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n+ DefaultNewArchitectureEntryPoint.getFabricEnabled()));\n }\n \n /**\n@@ -59,25 +62,4 @@ public class MainActivity extends ReactActivity {\n // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n super.invokeDefaultOnBackPressed();\n }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\nindex 7deb688b07..e7f376902d 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n@@ -1,69 +1,76 @@\n package com.helloworld;\n \n import android.app.Application;\n-import android.content.Context;\n import android.content.res.Configuration;\n import androidx.annotation.NonNull;\n \n import com.facebook.react.PackageList;\n import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n import com.facebook.react.ReactNativeHost;\n import com.facebook.react.ReactPackage;\n import com.facebook.react.config.ReactFeatureFlags;\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;\n+import com.facebook.react.defaults.DefaultReactNativeHost;\n import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n \n import expo.modules.ApplicationLifecycleDispatcher;\n import expo.modules.ReactNativeHostWrapper;\n \n-import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n \n public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n \n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n+ private final ReactNativeHost mReactNativeHost =\n+ new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {\n+ @Override\n+ public boolean getUseDeveloperSupport() {\n+ return BuildConfig.DEBUG;\n+ }\n \n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n+ @Override\n+ protected List getPackages() {\n+ @SuppressWarnings(\"UnnecessaryLocalVariable\")\n+ List packages = new PackageList(this).getPackages();\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return packages;\n+ }\n \n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n+ @Override\n+ protected String getJSMainModuleName() {\n+ return \".expo/.virtual-metro-entry\";\n+ }\n+\n+ @Override\n+ protected boolean isNewArchEnabled() {\n+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n+ }\n+\n+ @Override\n+ protected Boolean isHermesEnabled() {\n+ return BuildConfig.IS_HERMES_ENABLED;\n+ }\n+ });\n \n @Override\n public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n+ return mReactNativeHost;\n }\n \n @Override\n public void onCreate() {\n super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false;\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ DefaultNewArchitectureEntryPoint.load();\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n+ }\n ApplicationLifecycleDispatcher.onApplicationCreate(this);\n }\n \n@@ -72,35 +79,4 @@ public class MainApplication extends Application implements ReactApplication {\n super.onConfigurationChanged(newConfig);\n ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n }\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\ndeleted file mode 100644\nindex d2cad3a326..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-cmake_minimum_required(VERSION 3.13)\n-\n-# Define the library name here.\n-project(helloworld_appmodules)\n-\n-# This file includes all the necessary to let you build your application with the New Architecture.\n-include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 26162dd872..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n-\n- // Module providers autolinked by RN CLI\n- auto rncli_module = rncli_ModuleProvider(moduleName, params);\n- if (rncli_module != nullptr) {\n- return rncli_module;\n- }\n-\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex b38ccf53fd..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex 5fd688c509..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- const std::string &name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 9ee38a81f6..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(const std::string &name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 54f598a486..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,65 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Autolinked providers registered by RN CLI\n- rncli_registerProviders(providerRegistry);\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n \n- \n+ \n \n \n \n@@ -29,4 +29,4 @@\n \n \n \n-\n+\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 576e23db45..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,57 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..8258c40ed4\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,65 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.config.ReactFeatureFlags\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.react.flipper.ReactNativeFlipper\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex f555e36448..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,116 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- new EmptyReactNativeConfig(),\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex 0ae6366756..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,49 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n \n- \n+ \n \n \n \n@@ -29,4 +29,4 @@\n \n \n \n-\n+\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 8e13797d9b..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n- */\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..8258c40ed4\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,65 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.config.ReactFeatureFlags\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.react.flipper.ReactNativeFlipper\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex cda1391225..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source\n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_runtime \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n \n- \n+ \n \n \n \n@@ -29,4 +29,4 @@\n \n \n \n-\n+\n\\ No newline at end of file\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 8e13797d9b..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n- */\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..8258c40ed4\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,65 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.config.ReactFeatureFlags\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.react.flipper.ReactNativeFlipper\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {\n+ ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false\n+ }\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ if (BuildConfig.DEBUG) {\n+ ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\ndeleted file mode 100644\nindex d2cad3a326..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-cmake_minimum_required(VERSION 3.13)\n-\n-# Define the library name here.\n-project(helloworld_appmodules)\n-\n-# This file includes all the necessary to let you build your application with the New Architecture.\n-include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 26162dd872..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n-\n- // Module providers autolinked by RN CLI\n- auto rncli_module = rncli_ModuleProvider(moduleName, params);\n- if (rncli_module != nullptr) {\n- return rncli_module;\n- }\n-\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex b38ccf53fd..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex 5fd688c509..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- const std::string &name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 9ee38a81f6..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(const std::string &name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 54f598a486..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,65 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Autolinked providers registered by RN CLI\n- rncli_registerProviders(providerRegistry);\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n- \n- \n+ \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 576e23db45..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,57 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this,\n- new ReactActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..95ef45de96\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,57 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex f555e36448..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,116 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- new EmptyReactNativeConfig(),\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex 0ae6366756..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,49 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source \n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_futures \\\n- libfolly_json \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n- \n- \n+ \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 8e13797d9b..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n- */\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..95ef45de96\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,57 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk b/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\ndeleted file mode 100644\nindex cda1391225..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/Android.mk\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-THIS_DIR := $(call my-dir)\n-\n-include $(REACT_ANDROID_DIR)/Android-prebuilt.mk\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to include the following autogenerated makefile.\n-# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk\n-include $(CLEAR_VARS)\n-\n-LOCAL_PATH := $(THIS_DIR)\n-\n-# You can customize the name of your application .so file here.\n-LOCAL_MODULE := helloworld_appmodules\n-\n-LOCAL_C_INCLUDES := $(LOCAL_PATH)\n-LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)\n-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n-\n-# If you wish to add a custom TurboModule or Fabric component in your app you\n-# will have to uncomment those lines to include the generated source\n-# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)\n-#\n-# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)\n-# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni\n-\n-# Here you should add any native library you wish to depend on.\n-LOCAL_SHARED_LIBRARIES := \\\n- libfabricjni \\\n- libfbjni \\\n- libfolly_runtime \\\n- libglog \\\n- libjsi \\\n- libreact_codegen_rncore \\\n- libreact_debug \\\n- libreact_nativemodule_core \\\n- libreact_render_componentregistry \\\n- libreact_render_core \\\n- libreact_render_debug \\\n- libreact_render_graphics \\\n- librrc_view \\\n- libruntimeexecutor \\\n- libturbomodulejsijni \\\n- libyoga\n-\n-LOCAL_CFLAGS := -DLOG_TAG=\\\"ReactNative\\\" -fexceptions -frtti -std=c++17 -Wall\n-\n-include $(BUILD_SHARED_LIBRARY)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 0ac23cc626..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex 0fa43fa69a..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex dbbdc3d132..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- std::string name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 25f27722d0..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const std::shared_ptr jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(std::string name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 8f7edffd64..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n- \n@@ -18,10 +18,10 @@\n \n \n \n- \n+ \n \n- \n- \n+ \n+ \n \n \n \ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\ndeleted file mode 100644\nindex 8e13797d9b..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.java\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-package com.helloworld;\n-\n-import android.os.Build;\n-import android.os.Bundle;\n-\n-import com.facebook.react.ReactActivity;\n-import com.facebook.react.ReactActivityDelegate;\n-import com.facebook.react.ReactRootView;\n-\n-import expo.modules.ReactActivityDelegateWrapper;\n-\n-public class MainActivity extends ReactActivity {\n- @Override\n- protected void onCreate(Bundle savedInstanceState) {\n- // Set the theme to AppTheme BEFORE onCreate to support \n- // coloring the background, status bar, and navigation bar.\n- // This is required for expo-splash-screen.\n- setTheme(R.style.AppTheme);\n- super.onCreate(null);\n- }\n-\n- /**\n- * Returns the name of the main component registered from JavaScript.\n- * This is used to schedule rendering of the component.\n- */\n- @Override\n- protected String getMainComponentName() {\n- return \"main\";\n- }\n-\n- /**\n- * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and\n- * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer\n- * (Paper).\n- */\n- @Override\n- protected ReactActivityDelegate createReactActivityDelegate() {\n- return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n- new MainActivityDelegate(this, getMainComponentName())\n- );\n- }\n-\n- /**\n- * Align the back button behavior with Android S\n- * where moving root activities to background instead of finishing activities.\n- * @see onBackPressed\n- */\n- @Override\n- public void invokeDefaultOnBackPressed() {\n- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n- if (!moveTaskToBack(false)) {\n- // For non-root activities, use the default implementation to finish them.\n- super.invokeDefaultOnBackPressed();\n- }\n- return;\n- }\n-\n- // Use the default back button implementation on Android S\n- // because it's doing more than {@link Activity#moveTaskToBack} in fact.\n- super.invokeDefaultOnBackPressed();\n- }\n-\n- public static class MainActivityDelegate extends ReactActivityDelegate {\n- public MainActivityDelegate(ReactActivity activity, String mainComponentName) {\n- super(activity, mainComponentName);\n- }\n-\n- @Override\n- protected ReactRootView createRootView() {\n- ReactRootView reactRootView = new ReactRootView(getContext());\n- // If you opted-in for the New Architecture, we enable the Fabric Renderer.\n- reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);\n- return reactRootView;\n- }\n-\n- @Override\n- protected boolean isConcurrentRootEnabled() {\n- // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).\n- // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html\n- return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\nnew file mode 100644\nindex 0000000000..c4467326aa\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainActivity.kt\n@@ -0,0 +1,61 @@\n+package com.helloworld\n+\n+import android.os.Build\n+import android.os.Bundle\n+\n+import com.facebook.react.ReactActivity\n+import com.facebook.react.ReactActivityDelegate\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\n+import com.facebook.react.defaults.DefaultReactActivityDelegate\n+\n+import expo.modules.ReactActivityDelegateWrapper\n+\n+class MainActivity : ReactActivity() {\n+ override fun onCreate(savedInstanceState: Bundle?) {\n+ // Set the theme to AppTheme BEFORE onCreate to support\n+ // coloring the background, status bar, and navigation bar.\n+ // This is required for expo-splash-screen.\n+ setTheme(R.style.AppTheme);\n+ super.onCreate(null)\n+ }\n+\n+ /**\n+ * Returns the name of the main component registered from JavaScript. This is used to schedule\n+ * rendering of the component.\n+ */\n+ override fun getMainComponentName(): String = \"main\"\n+\n+ /**\n+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n+ */\n+ override fun createReactActivityDelegate(): ReactActivityDelegate {\n+ return ReactActivityDelegateWrapper(\n+ this,\n+ BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,\n+ object : DefaultReactActivityDelegate(\n+ this,\n+ mainComponentName,\n+ fabricEnabled\n+ ){})\n+ }\n+\n+ /**\n+ * Align the back button behavior with Android S\n+ * where moving root activities to background instead of finishing activities.\n+ * @see onBackPressed\n+ */\n+ override fun invokeDefaultOnBackPressed() {\n+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {\n+ if (!moveTaskToBack(false)) {\n+ // For non-root activities, use the default implementation to finish them.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+ return\n+ }\n+\n+ // Use the default back button implementation on Android S\n+ // because it's doing more than [Activity.moveTaskToBack] in fact.\n+ super.invokeDefaultOnBackPressed()\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\ndeleted file mode 100644\nindex 7deb688b07..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.java\n+++ /dev/null\n@@ -1,106 +0,0 @@\n-package com.helloworld;\n-\n-import android.app.Application;\n-import android.content.Context;\n-import android.content.res.Configuration;\n-import androidx.annotation.NonNull;\n-\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactApplication;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.config.ReactFeatureFlags;\n-import com.facebook.soloader.SoLoader;\n-import com.helloworld.newarchitecture.MainApplicationReactNativeHost;\n-\n-import expo.modules.ApplicationLifecycleDispatcher;\n-import expo.modules.ReactNativeHostWrapper;\n-\n-import java.lang.reflect.InvocationTargetException;\n-import java.util.List;\n-\n-public class MainApplication extends Application implements ReactApplication {\n- private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(\n- this,\n- new ReactNativeHost(this) {\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- @SuppressWarnings(\"UnnecessaryLocalVariable\")\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n- });\n-\n- private final ReactNativeHost mNewArchitectureNativeHost =\n- new ReactNativeHostWrapper(this, new MainApplicationReactNativeHost(this));\n-\n- @Override\n- public ReactNativeHost getReactNativeHost() {\n- if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n- return mNewArchitectureNativeHost;\n- } else {\n- return mReactNativeHost;\n- }\n- }\n-\n- @Override\n- public void onCreate() {\n- super.onCreate();\n- // If you opted-in for the New Architecture, we enable the TurboModule system\n- ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;\n- SoLoader.init(this, /* native exopackage */ false);\n-\n- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- ApplicationLifecycleDispatcher.onApplicationCreate(this);\n- }\n-\n- @Override\n- public void onConfigurationChanged(@NonNull Configuration newConfig) {\n- super.onConfigurationChanged(newConfig);\n- ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);\n- }\n-\n- /**\n- * Loads Flipper in React Native templates. Call this in the onCreate method with something like\n- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());\n- *\n- * @param context\n- * @param reactInstanceManager\n- */\n- private static void initializeFlipper(\n- Context context, ReactInstanceManager reactInstanceManager) {\n- if (BuildConfig.DEBUG) {\n- try {\n- /*\n- We use reflection here to pick up the class that initializes Flipper,\n- since Flipper library is not available in release mode\n- */\n- Class aClass = Class.forName(\"com.helloworld.ReactNativeFlipper\");\n- aClass\n- .getMethod(\"initializeFlipper\", Context.class, ReactInstanceManager.class)\n- .invoke(null, context, reactInstanceManager);\n- } catch (ClassNotFoundException e) {\n- e.printStackTrace();\n- } catch (NoSuchMethodException e) {\n- e.printStackTrace();\n- } catch (IllegalAccessException e) {\n- e.printStackTrace();\n- } catch (InvocationTargetException e) {\n- e.printStackTrace();\n- }\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\nnew file mode 100644\nindex 0000000000..95ef45de96\n--- /dev/null\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/MainApplication.kt\n@@ -0,0 +1,57 @@\n+package com.helloworld\n+\n+import android.app.Application\n+import android.content.res.Configuration\n+import androidx.annotation.NonNull\n+\n+import com.facebook.react.PackageList\n+import com.facebook.react.ReactApplication\n+import com.facebook.react.ReactNativeHost\n+import com.facebook.react.ReactPackage\n+import com.facebook.react.ReactHost\n+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\n+import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\n+import com.facebook.react.defaults.DefaultReactNativeHost\n+import com.facebook.soloader.SoLoader\n+\n+import expo.modules.ApplicationLifecycleDispatcher\n+import expo.modules.ReactNativeHostWrapper\n+\n+class MainApplication : Application(), ReactApplication {\n+\n+ override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(\n+ this,\n+ object : DefaultReactNativeHost(this) {\n+ override fun getPackages(): List {\n+ // Packages that cannot be autolinked yet can be added manually here, for example:\n+ // packages.add(new MyReactNativePackage());\n+ return PackageList(this).packages\n+ }\n+\n+ override fun getJSMainModuleName(): String = \".expo/.virtual-metro-entry\"\n+\n+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n+\n+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n+ }\n+ )\n+\n+ override val reactHost: ReactHost\n+ get() = getDefaultReactHost(this.applicationContext, reactNativeHost)\n+\n+ override fun onCreate() {\n+ super.onCreate()\n+ SoLoader.init(this, false)\n+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n+ // If you opted-in for the New Architecture, we load the native entry point for this app.\n+ load()\n+ }\n+ ApplicationLifecycleDispatcher.onApplicationCreate(this)\n+ }\n+\n+ override fun onConfigurationChanged(newConfig: Configuration) {\n+ super.onConfigurationChanged(newConfig)\n+ ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)\n+ }\n+}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\ndeleted file mode 100644\nindex 7665dd923f..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java\n+++ /dev/null\n@@ -1,117 +0,0 @@\n-package com.helloworld.newarchitecture;\n-\n-import android.app.Application;\n-import androidx.annotation.NonNull;\n-import com.facebook.react.PackageList;\n-import com.facebook.react.ReactInstanceManager;\n-import com.facebook.react.ReactNativeHost;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.JSIModulePackage;\n-import com.facebook.react.bridge.JSIModuleProvider;\n-import com.facebook.react.bridge.JSIModuleSpec;\n-import com.facebook.react.bridge.JSIModuleType;\n-import com.facebook.react.bridge.JavaScriptContextHolder;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.react.bridge.UIManager;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.react.fabric.CoreComponentsRegistry;\n-import com.facebook.react.fabric.EmptyReactNativeConfig;\n-import com.facebook.react.fabric.FabricJSIModuleProvider;\n-import com.facebook.react.fabric.ReactNativeConfig;\n-import com.facebook.react.uimanager.ViewManagerRegistry;\n-import com.helloworld.BuildConfig;\n-import com.helloworld.newarchitecture.components.MainComponentsRegistry;\n-import com.helloworld.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;\n-import java.util.ArrayList;\n-import java.util.List;\n-\n-/**\n- * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both\n- * TurboModule delegates and the Fabric Renderer.\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationReactNativeHost extends ReactNativeHost {\n- public MainApplicationReactNativeHost(Application application) {\n- super(application);\n- }\n-\n- @Override\n- public boolean getUseDeveloperSupport() {\n- return BuildConfig.DEBUG;\n- }\n-\n- @Override\n- protected List getPackages() {\n- List packages = new PackageList(this).getPackages();\n- // Packages that cannot be autolinked yet can be added manually here, for example:\n- // packages.add(new MyReactNativePackage());\n- // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:\n- // packages.add(new TurboReactPackage() { ... });\n- // If you have custom Fabric Components, their ViewManagers should also be loaded here\n- // inside a ReactPackage.\n- return packages;\n- }\n-\n- @Override\n- protected String getJSMainModuleName() {\n- return \"index\";\n- }\n-\n- @NonNull\n- @Override\n- protected ReactPackageTurboModuleManagerDelegate.Builder\n- getReactPackageTurboModuleManagerDelegateBuilder() {\n- // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary\n- // for the new architecture and to use TurboModules correctly.\n- return new MainApplicationTurboModuleManagerDelegate.Builder();\n- }\n-\n- @Override\n- protected JSIModulePackage getJSIModulePackage() {\n- return new JSIModulePackage() {\n- @Override\n- public List getJSIModules(\n- final ReactApplicationContext reactApplicationContext,\n- final JavaScriptContextHolder jsContext) {\n- final List specs = new ArrayList<>();\n-\n- // Here we provide a new JSIModuleSpec that will be responsible of providing the\n- // custom Fabric Components.\n- specs.add(\n- new JSIModuleSpec() {\n- @Override\n- public JSIModuleType getJSIModuleType() {\n- return JSIModuleType.UIManager;\n- }\n-\n- @Override\n- public JSIModuleProvider getJSIModuleProvider() {\n- final ComponentFactory componentFactory = new ComponentFactory();\n- CoreComponentsRegistry.register(componentFactory);\n-\n- // Here we register a Components Registry.\n- // The one that is generated with the template contains no components\n- // and just provides you the one from React Native core.\n- MainComponentsRegistry.register(componentFactory);\n-\n- final ReactInstanceManager reactInstanceManager = getReactInstanceManager();\n-\n- ViewManagerRegistry viewManagerRegistry =\n- new ViewManagerRegistry(\n- reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));\n-\n- return new FabricJSIModuleProvider(\n- reactApplicationContext,\n- componentFactory,\n- ReactNativeConfig.DEFAULT_CONFIG,\n- viewManagerRegistry);\n- }\n- });\n- return specs;\n- }\n- };\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\ndeleted file mode 100644\nindex c74d0ccadb..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/components/MainComponentsRegistry.java\n+++ /dev/null\n@@ -1,36 +0,0 @@\n-package com.helloworld.newarchitecture.components;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.proguard.annotations.DoNotStrip;\n-import com.facebook.react.fabric.ComponentFactory;\n-import com.facebook.soloader.SoLoader;\n-\n-/**\n- * Class responsible to load the custom Fabric Components. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-@DoNotStrip\n-public class MainComponentsRegistry {\n- static {\n- SoLoader.loadLibrary(\"fabricjni\");\n- }\n-\n- @DoNotStrip private final HybridData mHybridData;\n-\n- @DoNotStrip\n- private native HybridData initHybrid(ComponentFactory componentFactory);\n-\n- @DoNotStrip\n- private MainComponentsRegistry(ComponentFactory componentFactory) {\n- mHybridData = initHybrid(componentFactory);\n- }\n-\n- @DoNotStrip\n- public static MainComponentsRegistry register(ComponentFactory componentFactory) {\n- return new MainComponentsRegistry(componentFactory);\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\ndeleted file mode 100644\nindex 8593b3bb85..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/java/com/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java\n+++ /dev/null\n@@ -1,48 +0,0 @@\n-package com.helloworld.newarchitecture.modules;\n-\n-import com.facebook.jni.HybridData;\n-import com.facebook.react.ReactPackage;\n-import com.facebook.react.ReactPackageTurboModuleManagerDelegate;\n-import com.facebook.react.bridge.ReactApplicationContext;\n-import com.facebook.soloader.SoLoader;\n-import java.util.List;\n-\n-/**\n- * Class responsible to load the TurboModules. This class has native methods and needs a\n- * corresponding C++ implementation/header file to work correctly (already placed inside the jni/\n- * folder for you).\n- *\n- *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the\n- * `newArchEnabled` property). Is ignored otherwise.\n- */\n-public class MainApplicationTurboModuleManagerDelegate\n- extends ReactPackageTurboModuleManagerDelegate {\n-\n- private static volatile boolean sIsSoLibraryLoaded;\n-\n- protected MainApplicationTurboModuleManagerDelegate(\n- ReactApplicationContext reactApplicationContext, List packages) {\n- super(reactApplicationContext, packages);\n- }\n-\n- protected native HybridData initHybrid();\n-\n- native boolean canCreateTurboModule(String moduleName);\n-\n- public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {\n- protected MainApplicationTurboModuleManagerDelegate build(\n- ReactApplicationContext context, List packages) {\n- return new MainApplicationTurboModuleManagerDelegate(context, packages);\n- }\n- }\n-\n- @Override\n- protected synchronized void maybeLoadOtherSoLibraries() {\n- if (!sIsSoLibraryLoaded) {\n- // If you change the name of your application .so file in the Android.mk file,\n- // make sure you update the name here as well.\n- SoLoader.loadLibrary(\"helloworld_appmodules\");\n- sIsSoLibraryLoaded = true;\n- }\n- }\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt b/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\ndeleted file mode 100644\nindex d2cad3a326..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/CMakeLists.txt\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-cmake_minimum_required(VERSION 3.13)\n-\n-# Define the library name here.\n-project(helloworld_appmodules)\n-\n-# This file includes all the necessary to let you build your application with the New Architecture.\n-include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\ndeleted file mode 100644\nindex 26162dd872..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.cpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#include \"MainApplicationModuleProvider.h\"\n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms) {\n- // Here you can provide your own module provider for TurboModules coming from\n- // either your application or from external libraries. The approach to follow\n- // is similar to the following (for a library called `samplelibrary`:\n- //\n- // auto module = samplelibrary_ModuleProvider(moduleName, params);\n- // if (module != nullptr) {\n- // return module;\n- // }\n- // return rncore_ModuleProvider(moduleName, params);\n-\n- // Module providers autolinked by RN CLI\n- auto rncli_module = rncli_ModuleProvider(moduleName, params);\n- if (rncli_module != nullptr) {\n- return rncli_module;\n- }\n-\n- return rncore_ModuleProvider(moduleName, params);\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\ndeleted file mode 100644\nindex b38ccf53fd..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationModuleProvider.h\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-\n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-std::shared_ptr MainApplicationModuleProvider(\n- const std::string &moduleName,\n- const JavaTurboModule::InitParams ¶ms);\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\ndeleted file mode 100644\nindex 5fd688c509..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainApplicationModuleProvider.h\"\n-\n-namespace facebook {\n-namespace react {\n-\n-jni::local_ref\n-MainApplicationTurboModuleManagerDelegate::initHybrid(\n- jni::alias_ref) {\n- return makeCxxInstance();\n-}\n-\n-void MainApplicationTurboModuleManagerDelegate::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\n- \"initHybrid\", MainApplicationTurboModuleManagerDelegate::initHybrid),\n- makeNativeMethod(\n- \"canCreateTurboModule\",\n- MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),\n- });\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) {\n- // Not implemented yet: provide pure-C++ NativeModules here.\n- return nullptr;\n-}\n-\n-std::shared_ptr\n-MainApplicationTurboModuleManagerDelegate::getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) {\n- return MainApplicationModuleProvider(name, params);\n-}\n-\n-bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(\n- const std::string &name) {\n- return getTurboModule(name, nullptr) != nullptr ||\n- getTurboModule(name, {.moduleName = name}) != nullptr;\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\ndeleted file mode 100644\nindex 9ee38a81f6..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-#include \n-#include \n-\n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainApplicationTurboModuleManagerDelegate\n- : public jni::HybridClass<\n- MainApplicationTurboModuleManagerDelegate,\n- TurboModuleManagerDelegate> {\n- public:\n- // Adapt it to the package you used for your Java class.\n- static constexpr auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;\";\n-\n- static jni::local_ref initHybrid(jni::alias_ref);\n-\n- static void registerNatives();\n-\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const std::shared_ptr &jsInvoker) override;\n- std::shared_ptr getTurboModule(\n- const std::string &name,\n- const JavaTurboModule::InitParams ¶ms) override;\n-\n- /**\n- * Test-only method. Allows user to verify whether a TurboModule can be\n- * created by instances of this class.\n- */\n- bool canCreateTurboModule(const std::string &name);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\ndeleted file mode 100644\nindex 54f598a486..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.cpp\n+++ /dev/null\n@@ -1,65 +0,0 @@\n-#include \"MainComponentsRegistry.h\"\n-\n-#include \n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}\n-\n-std::shared_ptr\n-MainComponentsRegistry::sharedProviderRegistry() {\n- auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();\n-\n- // Autolinked providers registered by RN CLI\n- rncli_registerProviders(providerRegistry);\n-\n- // Custom Fabric Components go here. You can register custom\n- // components coming from your App or from 3rd party libraries here.\n- //\n- // providerRegistry->add(concreteComponentDescriptorProvider<\n- // AocViewerComponentDescriptor>());\n- return providerRegistry;\n-}\n-\n-jni::local_ref\n-MainComponentsRegistry::initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate) {\n- auto instance = makeCxxInstance(delegate);\n-\n- auto buildRegistryFunction =\n- [](EventDispatcher::Weak const &eventDispatcher,\n- ContextContainer::Shared const &contextContainer)\n- -> ComponentDescriptorRegistry::Shared {\n- auto registry = MainComponentsRegistry::sharedProviderRegistry()\n- ->createComponentDescriptorRegistry(\n- {eventDispatcher, contextContainer});\n-\n- auto mutableRegistry =\n- std::const_pointer_cast(registry);\n-\n- mutableRegistry->setFallbackComponentDescriptor(\n- std::make_shared(\n- ComponentDescriptorParameters{\n- eventDispatcher, contextContainer, nullptr}));\n-\n- return registry;\n- };\n-\n- delegate->buildRegistryFunction = buildRegistryFunction;\n- return instance;\n-}\n-\n-void MainComponentsRegistry::registerNatives() {\n- registerHybrid({\n- makeNativeMethod(\"initHybrid\", MainComponentsRegistry::initHybrid),\n- });\n-}\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h b/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\ndeleted file mode 100644\nindex d61cbffaae..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/MainComponentsRegistry.h\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-#pragma once\n-\n-#include \n-#include \n-#include \n-#include \n-\n-namespace facebook {\n-namespace react {\n-\n-class MainComponentsRegistry\n- : public facebook::jni::HybridClass {\n- public:\n- // Adapt it to the package you used for your Java class.\n- constexpr static auto kJavaDescriptor =\n- \"Lcom/helloworld/newarchitecture/components/MainComponentsRegistry;\";\n-\n- static void registerNatives();\n-\n- MainComponentsRegistry(ComponentFactory *delegate);\n-\n- private:\n- static std::shared_ptr\n- sharedProviderRegistry();\n-\n- static jni::local_ref initHybrid(\n- jni::alias_ref,\n- ComponentFactory *delegate);\n-};\n-\n-} // namespace react\n-} // namespace facebook\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp b/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\ndeleted file mode 100644\nindex c569b6e865..0000000000\n--- a/templates/expo-template-bare-minimum/android/app/src/main/jni/OnLoad.cpp\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \n-#include \"MainApplicationTurboModuleManagerDelegate.h\"\n-#include \"MainComponentsRegistry.h\"\n-\n-JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {\n- return facebook::jni::initialize(vm, [] {\n- facebook::react::MainApplicationTurboModuleManagerDelegate::\n- registerNatives();\n- facebook::react::MainComponentsRegistry::registerNatives();\n- });\n-}\ndiff --git a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\nindex f35d996202..73b37e4d99 100644\n--- a/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n+++ b/templates/expo-template-bare-minimum/android/app/src/main/res/drawable/rn_edit_text_material.xml\n@@ -20,7 +20,7 @@\n android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\">\n \n \n-