Skip to content

Commit 37aa4da

Browse files
abueideclaude
andcommitted
feat(e2e-latest): enable New Architecture (RN 0.84)
- Set newArchEnabled=true in gradle.properties - Rewrite settings.gradle to use RN 0.84 autolinking - Add kotlin-android plugin, remove old native_modules.gradle - Simplify Podfile (remove deprecated flags/workarounds) - Bump Kotlin to 2.1.20, minSdkVersion to 24 (New Arch requirement) - Add detox dependency to package.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b5f96d6 commit 37aa4da

8 files changed

Lines changed: 905 additions & 51 deletions

File tree

examples/E2E-latest/android/app/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

45
/**
@@ -122,5 +123,3 @@ dependencies {
122123
implementation jscFlavor
123124
}
124125
}
125-
126-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

examples/E2E-latest/android/build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22

33
buildscript {
44
ext {
5-
def compileSdkEnv = System.getenv("ANDROID_COMPILE_SDK") ?: System.getenv("ANDROID_MAX_API") ?: "33"
6-
def targetSdkEnv = System.getenv("ANDROID_TARGET_SDK") ?: System.getenv("ANDROID_MAX_API") ?: "33"
5+
def compileSdkEnv = System.getenv("ANDROID_COMPILE_SDK") ?: System.getenv("ANDROID_MAX_API") ?: "36"
6+
def targetSdkEnv = System.getenv("ANDROID_TARGET_SDK") ?: System.getenv("ANDROID_MAX_API") ?: "36"
77
buildToolsVersion = System.getenv("ANDROID_BUILD_TOOLS_VERSION") ?: "36.1.0"
8-
minSdkVersion = 21
8+
minSdkVersion = 24
99
compileSdkVersion = compileSdkEnv.toInteger()
1010
targetSdkVersion = targetSdkEnv.toInteger()
11-
kotlinVersion = "1.7.20"
11+
kotlinVersion = "2.1.20"
1212
def ndkVersionEnv = System.getenv("ANDROID_NDK_VERSION")
1313
if (ndkVersionEnv) {
1414
ndkVersion = ndkVersionEnv
15-
} else {
16-
ndkVersion = "23.1.7779620"
1715
}
1816
}
1917
repositories {

examples/E2E-latest/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3434
# your application. You should enable this flag either if you want
3535
# to write custom TurboModules/Fabric components OR use libraries that
3636
# are providing them.
37-
newArchEnabled=false
37+
newArchEnabled=true
3838

3939
# Use this property to enable or disable the Hermes JS engine.
4040
# If set to false, you will be using JSC instead.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
2+
plugins { id("com.facebook.react.settings") }
3+
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
14
rootProject.name = 'AnalyticsReactNativeE2E'
2-
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
35
include ':app'
46
includeBuild('../node_modules/@react-native/gradle-plugin')

examples/E2E-latest/ios/Podfile

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@ end
1717
target 'AnalyticsReactNativeE2E' do
1818
config = use_native_modules!
1919

20-
# Flags change depending on the env values.
21-
flags = get_default_flags()
22-
2320
use_react_native!(
2421
:path => config[:reactNativePath],
25-
# Hermes is now enabled by default. Disable by setting this flag to false.
26-
:hermes_enabled => flags[:hermes_enabled],
27-
:fabric_enabled => flags[:fabric_enabled],
2822
# An absolute path to your application root.
2923
:app_path => "#{Pod::Config.instance.installation_root}/.."
3024
)
@@ -35,18 +29,11 @@ target 'AnalyticsReactNativeE2E' do
3529
end
3630

3731
post_install do |installer|
38-
installer.pods_project.targets.each do |target|
39-
target.build_configurations.each do |config|
40-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
41-
end
42-
end
4332
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
4433
react_native_post_install(
4534
installer,
4635
config[:reactNativePath],
4736
:mac_catalyst_enabled => false
4837
)
49-
# BREAKING CHANGE: __apply_Xcode_12_5_M1_post_install_workaround removed in RN 0.84
50-
# __apply_Xcode_12_5_M1_post_install_workaround(installer)
5138
end
5239
end

examples/E2E-latest/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2288,6 +2288,6 @@ SPEC CHECKSUMS:
22882288
sovran-react-native: eec37f82e4429f0e3661f46aaf4fcd85d1b54f60
22892289
Yoga: c0b3f2c7e8d3e327e450223a2414ca3fa296b9a2
22902290

2291-
PODFILE CHECKSUM: 2173bf0c7110a6c59bf8d8b688f692516bd0df8b
2291+
PODFILE CHECKSUM: 10323a8f5dbb924a74acb0481e496beb99b40f1a
22922292

22932293
COCOAPODS: 1.16.2

examples/E2E-latest/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
"@babel/core": "^7.23.3",
3838
"@babel/preset-env": "^7.23.3",
3939
"@babel/runtime": "^7.23.2",
40+
"@react-native-community/cli": "^20.0.0",
41+
"@react-native-community/cli-platform-android": "^20.0.0",
42+
"@react-native-community/cli-platform-ios": "^20.0.0",
4043
"@react-native/eslint-config": "^0.77.0",
4144
"@react-native/metro-config": "^0.77.0",
4245
"@segment/analytics-react-native-e2e-tests": "file:../shared-e2e",

0 commit comments

Comments
 (0)