diff --git a/.buildkite/jobs/pipeline.android_demo_app_rn_74.yml b/.buildkite/jobs/pipeline.android_demo_app_rn_75.yml similarity index 81% rename from .buildkite/jobs/pipeline.android_demo_app_rn_74.yml rename to .buildkite/jobs/pipeline.android_demo_app_rn_75.yml index 131da20242..2b76e23d0a 100644 --- a/.buildkite/jobs/pipeline.android_demo_app_rn_74.yml +++ b/.buildkite/jobs/pipeline.android_demo_app_rn_75.yml @@ -1,9 +1,9 @@ - - label: ":android::react: RN .74 + Android: Demo app" + - label: ":android::react: RN .75 + Android: Demo app" command: - "nvm install" - "./scripts/demo-projects.android.sh" env: - REACT_NATIVE_VERSION: 0.74.6 + REACT_NATIVE_VERSION: 0.75.4 REACT_NATIVE_COMPAT_TEST: true # Only set 'true' in jobs with the latest supported RN DETOX_DISABLE_POD_INSTALL: true DETOX_DISABLE_POSTINSTALL: true diff --git a/.buildkite/jobs/pipeline.android_rn_74.yml b/.buildkite/jobs/pipeline.android_rn_75.yml similarity index 79% rename from .buildkite/jobs/pipeline.android_rn_74.yml rename to .buildkite/jobs/pipeline.android_rn_75.yml index 030ca787fe..0b6b51e256 100644 --- a/.buildkite/jobs/pipeline.android_rn_74.yml +++ b/.buildkite/jobs/pipeline.android_rn_75.yml @@ -1,9 +1,9 @@ - - label: ":android::detox: RN .74 + Android: Tests app" + - label: ":android::detox: RN .75 + Android: Tests app" command: - "nvm install" - "./scripts/ci.android.sh" env: - REACT_NATIVE_VERSION: 0.74.6 + REACT_NATIVE_VERSION: 0.75.4 DETOX_DISABLE_POD_INSTALL: true DETOX_DISABLE_POSTINSTALL: true artifact_paths: diff --git a/.buildkite/jobs/pipeline.ios_demo_app_rn_74.yml b/.buildkite/jobs/pipeline.ios_demo_app_rn_75.yml similarity index 72% rename from .buildkite/jobs/pipeline.ios_demo_app_rn_74.yml rename to .buildkite/jobs/pipeline.ios_demo_app_rn_75.yml index 2ebc9493f4..623b1e35c6 100644 --- a/.buildkite/jobs/pipeline.ios_demo_app_rn_74.yml +++ b/.buildkite/jobs/pipeline.ios_demo_app_rn_75.yml @@ -1,9 +1,9 @@ - - label: ":ios::react: RN .74 + iOS: Demo app" + - label: ":ios::react: RN .75 + iOS: Demo app" command: - "nvm install" - "./scripts/demo-projects.ios.sh" env: - REACT_NATIVE_VERSION: 0.74.6 + REACT_NATIVE_VERSION: 0.75.4 artifact_paths: - "/Users/builder/uibuilder/work/coverage/**/*.lcov" - "/Users/builder/uibuilder/work/artifacts*.tar.gz" diff --git a/.buildkite/jobs/pipeline.ios_rn_74.yml b/.buildkite/jobs/pipeline.ios_rn_75.yml similarity index 76% rename from .buildkite/jobs/pipeline.ios_rn_74.yml rename to .buildkite/jobs/pipeline.ios_rn_75.yml index 048e1ae9c8..71332023d9 100644 --- a/.buildkite/jobs/pipeline.ios_rn_74.yml +++ b/.buildkite/jobs/pipeline.ios_rn_75.yml @@ -1,9 +1,9 @@ - - label: ":ios::detox: RN .74 + iOS: Tests app" + - label: ":ios::detox: RN .75 + iOS: Tests app" command: - "nvm install" - "./scripts/ci.ios.sh" env: - REACT_NATIVE_VERSION: 0.74.6 + REACT_NATIVE_VERSION: 0.75.4 artifact_paths: - "/Users/builder/uibuilder/work/coverage/**/*.lcov" - "/Users/builder/uibuilder/work/**/allure-report-*.html" diff --git a/.buildkite/pipeline_common.sh b/.buildkite/pipeline_common.sh index e4601d69fd..cae5e1e799 100755 --- a/.buildkite/pipeline_common.sh +++ b/.buildkite/pipeline_common.sh @@ -2,11 +2,11 @@ echo "steps:" -cat .buildkite/jobs/pipeline.ios_rn_74.yml +cat .buildkite/jobs/pipeline.ios_rn_75.yml cat .buildkite/jobs/pipeline.ios_rn_73.yml -cat .buildkite/jobs/pipeline.ios_demo_app_rn_74.yml +cat .buildkite/jobs/pipeline.ios_demo_app_rn_75.yml cat .buildkite/jobs/pipeline.ios_demo_app_rn_73.yml -cat .buildkite/jobs/pipeline.android_rn_74.yml +cat .buildkite/jobs/pipeline.android_rn_75.yml cat .buildkite/jobs/pipeline.android_rn_73.yml -cat .buildkite/jobs/pipeline.android_demo_app_rn_74.yml +cat .buildkite/jobs/pipeline.android_demo_app_rn_75.yml cat .buildkite/pipeline.post_processing.yml diff --git a/README.md b/README.md index 7bcd9eeb76..286ba0d935 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ The most difficult part of automated testing on mobile is the tip of the testing Detox was built from the ground up to support React Native projects. -While Detox should work out of the box with almost any React Native version of the latest minor releases, official support is provided for React Native versions `0.71.x`, `0.72.x`, `0.73.x`, `0.74.x` without React Native's ["New Architecture"](https://reactnative.dev/docs/the-new-architecture/landing-page). +While Detox should work out of the box with almost any React Native version of the latest minor releases, official support is provided for React Native versions `0.72.x`, `0.73.x`, `0.74.x`, `0.75.x` with or without React Native's ["New Architecture"](https://reactnative.dev/docs/the-new-architecture/landing-page). Newer versions, as well as React Native's "New Architecture", may work with Detox, but have not been tested out yet by the Detox team. diff --git a/detox/android/build.gradle b/detox/android/build.gradle index 2afce02933..ed43b4202a 100644 --- a/detox/android/build.gradle +++ b/detox/android/build.gradle @@ -3,7 +3,7 @@ buildscript { ext { isOfficialDetoxLib = true - kotlinVersion = '1.9.20' + kotlinVersion = '1.9.24' dokkaVersion = '1.9.10' buildToolsVersion = '34.0.0' compileSdkVersion = 34 diff --git a/detox/android/detox/src/full/java/com/wix/detox/espresso/web/DetoxWebAtomMatcher.java b/detox/android/detox/src/full/java/com/wix/detox/espresso/web/DetoxWebAtomMatcher.java index 8ccd21138a..940ad50ddb 100644 --- a/detox/android/detox/src/full/java/com/wix/detox/espresso/web/DetoxWebAtomMatcher.java +++ b/detox/android/detox/src/full/java/com/wix/detox/espresso/web/DetoxWebAtomMatcher.java @@ -1,14 +1,14 @@ package com.wix.detox.espresso.web; +import static androidx.test.espresso.web.webdriver.DriverAtoms.findMultipleElements; + import androidx.test.espresso.web.model.Atom; import androidx.test.espresso.web.model.ElementReference; import androidx.test.espresso.web.webdriver.Locator; import java.util.List; -import static androidx.test.espresso.web.webdriver.DriverAtoms.findMultipleElements; - public class DetoxWebAtomMatcher { private DetoxWebAtomMatcher() { @@ -46,4 +46,4 @@ public static Atom> matcherForPartialLinkText(String part public static Atom> matcherForTagName(String tag) { return findMultipleElements(Locator.TAG_NAME, tag); } -} \ No newline at end of file +} diff --git a/detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebElement.java b/detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebElement.java index 695465d782..488f302d8d 100644 --- a/detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebElement.java +++ b/detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebElement.java @@ -3,7 +3,6 @@ import androidx.test.espresso.web.model.Atom; import androidx.test.espresso.web.model.Atoms; import androidx.test.espresso.web.model.ElementReference; -import androidx.test.espresso.web.model.Evaluation; import androidx.test.espresso.web.model.SimpleAtom; import androidx.test.espresso.web.sugar.Web; import androidx.test.espresso.web.webdriver.DriverAtoms; diff --git a/detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebViewElement.java b/detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebViewElement.java index 778037a30a..0b84ce8c3a 100644 --- a/detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebViewElement.java +++ b/detox/android/detox/src/full/java/com/wix/detox/espresso/web/WebViewElement.java @@ -1,5 +1,7 @@ package com.wix.detox.espresso.web; +import static androidx.test.espresso.web.sugar.Web.onWebView; + import android.view.View; import android.webkit.WebView; @@ -7,24 +9,47 @@ import androidx.test.espresso.web.model.ElementReference; import androidx.test.espresso.web.sugar.Web; -import org.hamcrest.CoreMatchers; +import org.hamcrest.Description; import org.hamcrest.Matcher; +import org.hamcrest.TypeSafeMatcher; import java.util.List; import javax.annotation.Nullable; -import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; -import static androidx.test.espresso.web.sugar.Web.onWebView; -import static org.hamcrest.CoreMatchers.allOf; - public class WebViewElement { - final Matcher matcher; + private final static String WRAPPER_WEBVIEW_CLASS_NAME = "RNCWebViewWrapper"; + final Web.WebInteraction webViewInteraction; - WebViewElement(@Nullable Matcher matcher) { - this.matcher = matcher != null ? matcher : allOf(CoreMatchers.instanceOf(WebView.class), isDisplayed()); + WebViewElement(@Nullable Matcher userMatcher) { + Matcher matcher = null; + + if (userMatcher != null) { + matcher = new TypeSafeMatcher<>() { + + @Override + protected boolean matchesSafely(View item) { + // Support for react-native-webview >= 13.0.0 + if (item instanceof WebView && item.getParent().getClass().getSimpleName().equals(WRAPPER_WEBVIEW_CLASS_NAME)) { + return userMatcher.matches(item.getParent()); + } + + if (item.getClass().getSimpleName().equals("RNCWebViewWrapper")) { + // We never want to match the wrapper of the webview + return false; + } + + return userMatcher.matches(item); + } + + @Override + public void describeTo(Description description) { + userMatcher.describeTo(description); + } + }; + } this.webViewInteraction = matcher != null ? onWebView(matcher) : onWebView(); } diff --git a/detox/android/gradle/wrapper/gradle-wrapper.properties b/detox/android/gradle/wrapper/gradle-wrapper.properties index a80b22ce5c..a4413138c9 100644 --- a/detox/android/gradle/wrapper/gradle-wrapper.properties +++ b/detox/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/detox/android/rninfo.gradle b/detox/android/rninfo.gradle index eb7d649af3..284920b9d5 100644 --- a/detox/android/rninfo.gradle +++ b/detox/android/rninfo.gradle @@ -41,4 +41,5 @@ ext.rnInfo = [ isRN72OrHigher: rnMajorVer >= 72, isRN73OrHigher: rnMajorVer >= 73, isRN74OrHigher: rnMajorVer >= 74, + isRN75OrHigher: rnMajorVer >= 75, ] diff --git a/detox/android/settings.gradle b/detox/android/settings.gradle index 2541ebac02..4f3e8d3746 100644 --- a/detox/android/settings.gradle +++ b/detox/android/settings.gradle @@ -1,10 +1,17 @@ +// RN75+_BLOCK_START +pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } +plugins { id("com.facebook.react.settings") } +extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } +// RN75+_BLOCK_END + + apply from: '../android/rninfo.gradle' include ':detox' println("RNInfo: rootDir=$rootDir") - println "[settings] RNInfo: detected React Native version: (major=${ext.rnInfo.version})" + if (ext.rnInfo.isRN72OrHigher) { includeBuild('../node_modules/@react-native/gradle-plugin') } else { diff --git a/detox/package.json b/detox/package.json index 6eda1654a8..7b51cdc2bd 100644 --- a/detox/package.json +++ b/detox/package.json @@ -34,10 +34,10 @@ "postinstall": "node scripts/postinstall.js" }, "devDependencies": { - "@react-native/babel-preset": "0.74.88", - "@react-native/eslint-config": "0.74.88", - "@react-native/metro-config": "0.74.88", - "@react-native/typescript-config": "0.74.88", + "@react-native/babel-preset": "0.75.4", + "@react-native/eslint-config": "0.75.4", + "@react-native/metro-config": "0.75.4", + "@react-native/typescript-config": "0.75.4", "@tsconfig/react-native": "^3.0.0", "@types/bunyan": "^1.8.8", "@types/child-process-promise": "^2.2.1", @@ -59,7 +59,7 @@ "jest-allure2-reporter": "^2.0.0-beta.18", "metro-react-native-babel-preset": "0.76.8", "prettier": "^3.1.1", - "react-native": "0.74.6", + "react-native": "0.75.4", "react-native-codegen": "^0.0.8", "typescript": "^5.3.3", "wtfnode": "^0.9.1" diff --git a/detox/scripts/postinstall.js b/detox/scripts/postinstall.js index b03fbedd51..f1957898b4 100755 --- a/detox/scripts/postinstall.js +++ b/detox/scripts/postinstall.js @@ -1,6 +1,6 @@ const { platform, env } = process; -const { setGradleVersionByRNVersion } = require('./updateGradle'); +const { patchGradleByRNVersion } = require('./updateGradle'); const isDarwin = platform === 'darwin'; const shouldInstallDetox = !env.DETOX_DISABLE_POSTINSTALL; @@ -12,4 +12,4 @@ if (isDarwin && shouldInstallDetox) { execFileSync(`${__dirname}/build_local_xcuitest.ios.sh`, { stdio: 'inherit' }); } -setGradleVersionByRNVersion(); +patchGradleByRNVersion(); diff --git a/detox/scripts/updateGradle.js b/detox/scripts/updateGradle.js index 6d525edb9e..e3e45b19bd 100644 --- a/detox/scripts/updateGradle.js +++ b/detox/scripts/updateGradle.js @@ -6,6 +6,8 @@ const rnMinor = require('../src/utils/rn-consts/rn-consts').rnVersion.minor; function getGradleVersionByRNVersion() { switch (rnMinor) { default: + return '8.8'; + case '74': return '8.6'; case '73': return '8.3'; @@ -19,17 +21,44 @@ function getGradleVersionByRNVersion() { /** * Update the Gradle wrapper to the version that matches the React Native version. */ -function setGradleVersionByRNVersion() { - const gradleVersion = getGradleVersionByRNVersion(); - updateGradleWrapperSync(gradleVersion); +function patchGradleByRNVersion() { + updateGradleWrapperSync(); + patchSettingsGradle(); +} + +/** + * In RN75 and above the settings.gradle file should contain the following lines. We can't wrap them in 'if' statement + * because they should be the first line in the settings file. This patch could be safely removed after dropping support + * for RN74. + */ +function patchSettingsGradle() { + if (parseInt(rnMinor) >= 75) { + return; + } + + const settingsGradlePath = path.join(process.cwd(), 'android', 'settings.gradle'); + console.log(`Patching settings.gradle. File: ${settingsGradlePath}`); + + try { + let data = fs.readFileSync(settingsGradlePath, 'utf8'); + const blockRegex = /\/\/ RN75\+_BLOCK_START[\s\S]*?\/\/ RN75\+_BLOCK_END/g; + + // Replace the block with an empty string + const updatedData = data.replace(blockRegex, ''); + + fs.writeFileSync(settingsGradlePath, updatedData, 'utf8'); + console.log('settings.gradle patched successfully.'); + } catch (err) { + console.error('Error:', err); + } } /** * Update the Gradle wrapper to the specified version. - * - * @param {string} newVersion - the new Gradle wrapper version */ -function updateGradleWrapperSync(newVersion) { +function updateGradleWrapperSync() { + const newVersion = getGradleVersionByRNVersion(); + const gradleWrapperPath = path.join(process.cwd(), 'android', 'gradle', 'wrapper', 'gradle-wrapper.properties'); console.log(`Updating Gradle wrapper to version$ {newVersion}. File: ${gradleWrapperPath}`); @@ -45,5 +74,5 @@ function updateGradleWrapperSync(newVersion) { } module.exports = { - setGradleVersionByRNVersion + patchGradleByRNVersion: patchGradleByRNVersion }; diff --git a/detox/test/android/app/build.gradle b/detox/test/android/app/build.gradle index 3363cf85b7..464ead8b76 100644 --- a/detox/test/android/app/build.gradle +++ b/detox/test/android/app/build.gradle @@ -3,6 +3,11 @@ apply plugin: 'com.facebook.react' apply plugin: 'kotlin-android' apply from: '../../../android/rninfo.gradle' +react { + if (rnInfo.isRN75OrHigher) { + autolinkLibrariesWithApp() + } +} android { namespace 'com.example' @@ -100,15 +105,6 @@ dependencies { implementation "androidx.appcompat:appcompat:${rootProject.ext.appCompatVersion}" implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - implementation project(path: ':@react-native-community_slider') - implementation project(':AsyncStorage') - implementation project(':react-native-webview') - implementation project(':react-native-community-checkbox') - implementation project(':react-native-community-geolocation') - implementation project(':react-native-datetimepicker') - implementation project(':react-native-launcharguments') - implementation project(':react-native-permissions') - androidTestImplementation(project(path: ':detox')) androidTestImplementation 'com.github.wix-incubator:detox-butler:1.0.4' } @@ -124,3 +120,8 @@ task copyDownloadableDepsToLibs(type: Copy) { from configurations.implementation into 'libs' } + +if (!ext.rnInfo.isRN75OrHigher) { + // For versions below 0.75, we need to apply the old plugin + apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) +} diff --git a/detox/test/android/app/src/main/java/com/example/DetoxRNHost.java b/detox/test/android/app/src/main/java/com/example/DetoxRNHost.java deleted file mode 100644 index 6cceef33bf..0000000000 --- a/detox/test/android/app/src/main/java/com/example/DetoxRNHost.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.example; - -import android.app.Application; - -import com.facebook.react.ReactPackage; -import com.facebook.react.defaults.DefaultReactNativeHost; - -import java.util.List; - -class DetoxRNHost extends DefaultReactNativeHost { - protected DetoxRNHost(Application application) { - super(application); - } - - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected boolean isNewArchEnabled() { - return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - } - - @Override - protected Boolean isHermesEnabled() { - return BuildConfig.IS_HERMES_ENABLED; - } - - @Override - protected List getPackages() { - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: - // packages.add(new TurboReactPackage() { ... }); - // If you have custom Fabric Components, their ViewManagers should also be loaded here - // inside a ReactPackage. - return ReactNativeAdapter.getManualLinkPackages(); - } -} diff --git a/detox/test/android/app/src/main/java/com/example/DetoxRNHost.kt b/detox/test/android/app/src/main/java/com/example/DetoxRNHost.kt new file mode 100644 index 0000000000..758919b7a8 --- /dev/null +++ b/detox/test/android/app/src/main/java/com/example/DetoxRNHost.kt @@ -0,0 +1,23 @@ +package com.example + +import android.app.Application +import com.facebook.react.PackageList +import com.facebook.react.ReactPackage +import com.facebook.react.defaults.DefaultReactNativeHost + +internal class DetoxRNHost(application: Application) : DefaultReactNativeHost(application) { + + override fun getUseDeveloperSupport(): Boolean { + return BuildConfig.DEBUG + } + + override val isNewArchEnabled: Boolean + get() = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED + + override val isHermesEnabled: Boolean + get() = BuildConfig.IS_HERMES_ENABLED + + override fun getPackages(): List = PackageList(this).packages.apply { + add(NativeModulePackage()) + } +} diff --git a/detox/test/android/app/src/main/java/com/example/MainActivity.java b/detox/test/android/app/src/main/java/com/example/MainActivity.java deleted file mode 100644 index 1a0203a36d..0000000000 --- a/detox/test/android/app/src/main/java/com/example/MainActivity.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.example; - -import android.content.Intent; - -import com.facebook.react.ReactActivity; -import com.facebook.react.ReactActivityDelegate; - -public class MainActivity extends ReactActivity { - @Override - public void onNewIntent(Intent intent) { - super.onNewIntent(intent); - setIntent(intent); - } - - /** - * Returns the name of the main component registered from JavaScript. - * This is used to schedule rendering of the component. - */ - @Override - protected String getMainComponentName() { - return "example"; - } - - public static class MainActivityDelegate extends ReactActivityDelegate { - public MainActivityDelegate(ReactActivity activity, String mainComponentName) { - super(activity, mainComponentName); - } - } -} diff --git a/detox/test/android/app/src/main/java/com/example/MainActivity.kt b/detox/test/android/app/src/main/java/com/example/MainActivity.kt new file mode 100644 index 0000000000..ca01208db4 --- /dev/null +++ b/detox/test/android/app/src/main/java/com/example/MainActivity.kt @@ -0,0 +1,27 @@ +package com.example + +import android.content.Intent +import com.facebook.react.ReactActivity +import com.facebook.react.ReactActivityDelegate +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled +import com.facebook.react.defaults.DefaultReactActivityDelegate + +open class MainActivity : ReactActivity() { + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + setIntent(intent) + } + + /** + * Returns the name of the main component registered from JavaScript. + * This is used to schedule rendering of the component. + */ + override fun getMainComponentName() = "example" + + /** + * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] + * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] + */ + override fun createReactActivityDelegate(): ReactActivityDelegate = + DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) +} diff --git a/detox/test/android/app/src/main/java/com/example/MainApplication.java b/detox/test/android/app/src/main/java/com/example/MainApplication.java deleted file mode 100644 index ac7fdc0ed0..0000000000 --- a/detox/test/android/app/src/main/java/com/example/MainApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.example; - -import android.app.Application; -import android.webkit.WebView; - -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.soloader.SoLoader; - -public class MainApplication extends Application implements ReactApplication { - private final ReactNativeHost mReactNativeHost = new DetoxRNHost(this); - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - - SoLoader.init(this, /* native exopackage */ false); - WebView.setWebContentsDebuggingEnabled(true); - } -} diff --git a/detox/test/android/app/src/main/java/com/example/MainApplication.kt b/detox/test/android/app/src/main/java/com/example/MainApplication.kt new file mode 100644 index 0000000000..5dfdfae2ec --- /dev/null +++ b/detox/test/android/app/src/main/java/com/example/MainApplication.kt @@ -0,0 +1,23 @@ +package com.example + +import android.app.Application +import android.webkit.WebView +import com.facebook.react.ReactApplication +import com.facebook.react.ReactNativeHost +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load +import com.facebook.soloader.SoLoader + +class MainApplication : Application(), ReactApplication { + override val reactNativeHost: ReactNativeHost = DetoxRNHost(this) + + override fun onCreate() { + super.onCreate() + + SoLoader.init(this, /* native exopackage */false) + WebView.setWebContentsDebuggingEnabled(true) + if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { + // If you opted-in for the New Architecture, we load the native entry point for this app. + load() + } + } +} diff --git a/detox/test/android/app/src/main/java/com/example/ReactNativeAdapter.java b/detox/test/android/app/src/main/java/com/example/ReactNativeAdapter.java deleted file mode 100644 index fe61cee526..0000000000 --- a/detox/test/android/app/src/main/java/com/example/ReactNativeAdapter.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.example; - -import com.facebook.react.ReactPackage; -import com.facebook.react.shell.MainReactPackage; -import com.reactcommunity.rndatetimepicker.RNDateTimePickerPackage; -import com.reactnativecommunity.asyncstorage.AsyncStoragePackage; -import com.reactnativecommunity.checkbox.ReactCheckBoxPackage; -import com.reactnativecommunity.geolocation.GeolocationPackage; -import com.reactnativecommunity.slider.ReactSliderPackage; -import com.reactnativecommunity.webview.RNCWebViewPackage; -import com.reactnativelauncharguments.LaunchArgumentsPackage; -import com.zoontek.rnpermissions.RNPermissionsPackage; - -import java.util.Arrays; -import java.util.List; - -class ReactNativeAdapter { - public static List getManualLinkPackages() { - return Arrays.asList( - new MainReactPackage(), - new ReactSliderPackage(), - new GeolocationPackage(), - new RNCWebViewPackage(), - new NativeModulePackage(), - new AsyncStoragePackage(), - new ReactCheckBoxPackage(), - new RNDateTimePickerPackage(), - new LaunchArgumentsPackage(), - new RNPermissionsPackage() - ); - } -} diff --git a/detox/test/android/build.gradle b/detox/test/android/build.gradle index 7e52890931..212a3b6547 100644 --- a/detox/test/android/build.gradle +++ b/detox/test/android/build.gradle @@ -3,7 +3,7 @@ buildscript { ext { isOfficialDetoxApp = true - kotlinVersion = '1.9.20' + kotlinVersion = '1.9.24' buildToolsVersion = '34.0.0' compileSdkVersion = 34 targetSdkVersion = 34 diff --git a/detox/test/android/gradle.properties b/detox/test/android/gradle.properties index a5fa801dff..964f22392f 100644 --- a/detox/test/android/gradle.properties +++ b/detox/test/android/gradle.properties @@ -21,8 +21,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m # Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true -# Automatically convert third-party libraries to use AndroidX -android.enableJetifier=true # Use this property to enable or disable the Hermes JS engine. # If set to false, you will be using JSC instead. diff --git a/detox/test/android/gradle/wrapper/gradle-wrapper.properties b/detox/test/android/gradle/wrapper/gradle-wrapper.properties index a80b22ce5c..a4413138c9 100644 --- a/detox/test/android/gradle/wrapper/gradle-wrapper.properties +++ b/detox/test/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/detox/test/android/settings.gradle b/detox/test/android/settings.gradle index 817e335210..88bb8d0eb1 100644 --- a/detox/test/android/settings.gradle +++ b/detox/test/android/settings.gradle @@ -1,9 +1,20 @@ +// RN75+_BLOCK_START +pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } +plugins { id("com.facebook.react.settings") } +extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } +// RN75+_BLOCK_END + apply from: file("../../android/rninfo.gradle") +println "[settings] RNInfo: detected React Native version: (major=${ext.rnInfo.version})" + +if (!ext.rnInfo.isRN75OrHigher) { + // For versions below 0.75, we need to apply the old plugin + apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) +} + rootProject.name = 'DetoxTest' include ':app' -println "[settings] RNInfo: detected React Native version: (major=${ext.rnInfo.version})" - if (ext.rnInfo.isRN72OrHigher) { includeBuild('../node_modules/@react-native/gradle-plugin') } else { @@ -12,27 +23,3 @@ if (ext.rnInfo.isRN72OrHigher) { include ':detox' project(':detox').projectDir = new File(rootProject.projectDir, '../../android/detox') - -include ':AsyncStorage' -project(':AsyncStorage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-async-storage/async-storage/android') - -include ':react-native-webview' -project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android') - -include ':react-native-community-checkbox' -project(':react-native-community-checkbox').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/checkbox/android') - -include ':react-native-community-geolocation' -project(':react-native-community-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/geolocation/android') - -include ':@react-native-community_slider' -project(':@react-native-community_slider').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/slider/android') - -include ':react-native-datetimepicker' -project(':react-native-datetimepicker').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/datetimepicker/android') - -include ':react-native-launcharguments' -project(':react-native-launcharguments').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-launch-arguments/android') - -include ':react-native-permissions' -project(':react-native-permissions').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-permissions/android') diff --git a/detox/test/e2e/assets/scroll-to-view-webview.android.png b/detox/test/e2e/assets/scroll-to-view-webview.android.png index 380e92f306..733d59615b 100644 Binary files a/detox/test/e2e/assets/scroll-to-view-webview.android.png and b/detox/test/e2e/assets/scroll-to-view-webview.android.png differ diff --git a/detox/test/e2e/assets/view-hierarchy-web-view.73.android.txt b/detox/test/e2e/assets/view-hierarchy-web-view.73.android.txt index 1043026a47..2ed43252ac 100644 --- a/detox/test/e2e/assets/view-hierarchy-web-view.73.android.txt +++ b/detox/test/e2e/assets/view-hierarchy-web-view.73.android.txt @@ -1,48 +1,54 @@ - - - - - - - - - - - - - - - - - - - - - -

First Webview

-

Form

-
-
-
- -
-

Form Results

-

Your first name is: No input yet

-

Content Editable

-
Name:
-

Text and link

-

Some text and a link.

-

This is a bottom paragraph with class.

- -"]]> -
-
-
-
-
-
-
- - -
-
+ + + + + + + + + + + + + + + + + + + + + + +

First Webview

+

Form

+
+
+
+ +
+ +

Form Results

+

Your first name is: No input yet

+ +

Content Editable

+
Name:
+ +

Text and link

+

Some text and a link.

+

This is a bottom paragraph with class.

+ + +"]]> +
+
+
+
+
+
+
+
+ + +
+
\ No newline at end of file diff --git a/detox/test/e2e/assets/view-hierarchy-web-view.73.ios.txt b/detox/test/e2e/assets/view-hierarchy-web-view.73.ios.txt index cdf809ae6d..22552e8c06 100644 --- a/detox/test/e2e/assets/view-hierarchy-web-view.73.ios.txt +++ b/detox/test/e2e/assets/view-hierarchy-web-view.73.ios.txt @@ -27,8 +27,8 @@ - - + +

First Webview

@@ -38,17 +38,21 @@
+

Form Results

Your first name is: No input yet

+

Content Editable

Name:
+

Text and link

Some text and a link.

This is a bottom paragraph with class.

+ ]]> -
-
+ +
@@ -61,4 +65,4 @@ - + \ No newline at end of file diff --git a/detox/test/e2e/assets/view-hierarchy-web-view.75.android.txt b/detox/test/e2e/assets/view-hierarchy-web-view.75.android.txt new file mode 100644 index 0000000000..2ed43252ac --- /dev/null +++ b/detox/test/e2e/assets/view-hierarchy-web-view.75.android.txt @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + +

First Webview

+

Form

+
+
+
+ +
+ +

Form Results

+

Your first name is: No input yet

+ +

Content Editable

+
Name:
+ +

Text and link

+

Some text and a link.

+

This is a bottom paragraph with class.

+ + +"]]> +
+
+
+
+
+
+
+
+ + +
+
\ No newline at end of file diff --git a/detox/test/e2e/assets/view-hierarchy-web-view.75.ios.txt b/detox/test/e2e/assets/view-hierarchy-web-view.75.ios.txt new file mode 100644 index 0000000000..8e020b72e1 --- /dev/null +++ b/detox/test/e2e/assets/view-hierarchy-web-view.75.ios.txt @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

First Webview

+

Form

+
+
+
+ +
+ +

Form Results

+

Your first name is: No input yet

+ +

Content Editable

+
Name:
+ +

Text and link

+

Some text and a link.

+

This is a bottom paragraph with class.

+ + +]]> +
+
+
+
+
+
+
+
+
+
+
+ +
+
\ No newline at end of file diff --git a/detox/test/e2e/assets/view-hierarchy-with-test-id-injection.75.android.txt b/detox/test/e2e/assets/view-hierarchy-with-test-id-injection.75.android.txt new file mode 100644 index 0000000000..e26d5f661c --- /dev/null +++ b/detox/test/e2e/assets/view-hierarchy-with-test-id-injection.75.android.txt @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/detox/test/e2e/assets/view-hierarchy-with-test-id-injection.75.ios.txt b/detox/test/e2e/assets/view-hierarchy-with-test-id-injection.75.ios.txt new file mode 100644 index 0000000000..fba29973c5 --- /dev/null +++ b/detox/test/e2e/assets/view-hierarchy-with-test-id-injection.75.ios.txt @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/detox/test/e2e/assets/view-hierarchy-without-test-id-injection.75.android.txt b/detox/test/e2e/assets/view-hierarchy-without-test-id-injection.75.android.txt new file mode 100644 index 0000000000..3bef9cb10f --- /dev/null +++ b/detox/test/e2e/assets/view-hierarchy-without-test-id-injection.75.android.txt @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/detox/test/e2e/assets/view-hierarchy-without-test-id-injection.75.ios.txt b/detox/test/e2e/assets/view-hierarchy-without-test-id-injection.75.ios.txt new file mode 100644 index 0000000000..fd1fc31bac --- /dev/null +++ b/detox/test/e2e/assets/view-hierarchy-without-test-id-injection.75.ios.txt @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/detox/test/ios/example.xcodeproj/project.pbxproj b/detox/test/ios/example.xcodeproj/project.pbxproj index fead653f31..95434ed05e 100644 --- a/detox/test/ios/example.xcodeproj/project.pbxproj +++ b/detox/test/ios/example.xcodeproj/project.pbxproj @@ -94,7 +94,7 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; }; - 18AB08AE5A45E52755A8055D /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 18AB08AE5A45E52755A8055D /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = ""; }; 399B4E061ED587120098D2AC /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39B0445B1DAED76400431EC5 /* Detox.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Detox.xcodeproj; path = ../../ios/Detox.xcodeproj; sourceTree = ""; }; 39B71FC924643AEA00CC9A88 /* exampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = exampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -108,7 +108,7 @@ 6027065D2B1DF4DD00CD52CF /* example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = example.entitlements; path = example/example.entitlements; sourceTree = ""; }; 6027065F2B1DF82400CD52CF /* example_ci.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = example_ci.entitlements; sourceTree = ""; }; 6CEAF92A5314EC6824AB3DE3 /* libPods-example_ci.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example_ci.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 75C5679B8378704E8D3D9C66 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 75C5679B8378704E8D3D9C66 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = ""; }; 86172A40F266BB07F101EB18 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A112C2B84196BF64AE1EFFA3 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = ""; }; A398C1445E8C769F5903CD2D /* Pods-example_ci.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example_ci.debug.xcconfig"; path = "Target Support Files/Pods-example_ci/Pods-example_ci.debug.xcconfig"; sourceTree = ""; }; @@ -817,6 +817,7 @@ OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; USE_HERMES = false; }; name = Debug; diff --git a/detox/test/package.json b/detox/test/package.json index 70f6618d15..2c1499ef18 100644 --- a/detox/test/package.json +++ b/detox/test/package.json @@ -31,33 +31,33 @@ "verify-artifacts:android": "jest ./scripts/verify_artifacts_are_not_missing.android.test.js --testEnvironment node" }, "dependencies": { - "@react-native-async-storage/async-storage": "^1.17.3", - "@react-native-community/checkbox": "0.5.16", + "@react-native-async-storage/async-storage": "^2.1.0", + "@react-native-community/checkbox": "^0.5.17", "@react-native-community/datetimepicker": "^8.2.0", - "@react-native-community/geolocation": "^3.2.1", - "@react-native-community/slider": "4.5.0", - "@react-native-picker/picker": "^2.1.0", - "@react-native-segmented-control/segmented-control": "2.3.0", - "moment": "^2.24.0", - "react": "18.2.0", - "react-native": "0.74.6", - "react-native-launch-arguments": "^4.0.0", - "react-native-permissions": "^4.0.2", - "react-native-webview": "^11.18.1", + "@react-native-community/geolocation": "^3.4.0", + "@react-native-community/slider": "^4.5.5", + "@react-native-picker/picker": "^2.10.1", + "@react-native-segmented-control/segmented-control": "^2.5.6", + "moment": "^2.30.1", + "react": "18.3.1", + "react-native": "0.75.4", + "react-native-launch-arguments": "^4.0.2", + "react-native-permissions": "^5.2.1", + "react-native-webview": "^13.12.4", "ssim.js": "^3.5.0" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", - "@react-native/babel-preset": "0.74.88", - "@react-native/eslint-config": "0.74.88", - "@react-native/metro-config": "0.74.88", - "@react-native/typescript-config": "0.74.88", + "@react-native/babel-preset": "0.75.4", + "@react-native/eslint-config": "0.75.4", + "@react-native/metro-config": "0.75.4", + "@react-native/typescript-config": "0.75.4", "@tsconfig/react-native": "^3.0.0", "@types/jest": "^29.5.11", "@types/node": "^16.18.68", - "@types/react": "^18.2.6", + "@types/react": "^18.3.1", "@typescript-eslint/eslint-plugin": "^6.16.0", "@typescript-eslint/parser": "^6.16.0", "axios": "^1.7.7", diff --git a/detox/test/scripts/postinstall.js b/detox/test/scripts/postinstall.js index c4df647ef1..f4bf7aa949 100644 --- a/detox/test/scripts/postinstall.js +++ b/detox/test/scripts/postinstall.js @@ -1,6 +1,6 @@ const fs = require('fs-extra'); const cp = require('child_process'); -const { setGradleVersionByRNVersion } = require('../../scripts/updateGradle'); +const { patchGradleByRNVersion } = require('../../scripts/updateGradle'); const patchBoostPodspec = () => { const log = message => console.log(`[POST-INSTALL] ${message}`); @@ -39,5 +39,5 @@ function podInstallIfRequired() { console.log('[POST-INSTALL] Running Detox\'s test-app post-install script...'); podInstallIfRequired(); -setGradleVersionByRNVersion() +patchGradleByRNVersion() console.log('[POST-INSTALL] Completed!'); diff --git a/examples/demo-react-native/android/app/build.gradle b/examples/demo-react-native/android/app/build.gradle index a631b1604c..38cd6180b4 100644 --- a/examples/demo-react-native/android/app/build.gradle +++ b/examples/demo-react-native/android/app/build.gradle @@ -1,6 +1,10 @@ apply plugin: 'com.android.application' apply plugin: 'com.facebook.react' +react { + autolinkLibrariesWithApp() +} + android { namespace 'com.example' @@ -71,8 +75,6 @@ dependencies { // Apply Hermes as the JS engine implementation 'com.facebook.react:hermes-android' - implementation(project(path: ':AsyncStorage')) // !!! Note: not required unless effectively used by your app - // noinspection GradleDynamicVersion androidTestImplementation 'com.wix:detox:+' androidTestImplementation 'com.linkedin.testbutler:test-butler-library:2.2.1' diff --git a/examples/demo-react-native/android/app/src/main/java/com/example/MainApplication.java b/examples/demo-react-native/android/app/src/main/java/com/example/MainApplication.java index 3b871d0dc9..a977bbac2a 100644 --- a/examples/demo-react-native/android/app/src/main/java/com/example/MainApplication.java +++ b/examples/demo-react-native/android/app/src/main/java/com/example/MainApplication.java @@ -2,6 +2,7 @@ import android.app.Application; +import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; @@ -21,10 +22,7 @@ public boolean getUseDeveloperSupport() { @Override protected List getPackages() { - return Arrays.asList( - new MainReactPackage(), - new AsyncStoragePackage() // Note: Not required unless effectively used by your app - ); + return new PackageList(this).getPackages(); } }; diff --git a/examples/demo-react-native/android/gradle/wrapper/gradle-wrapper.properties b/examples/demo-react-native/android/gradle/wrapper/gradle-wrapper.properties index a80b22ce5c..a4413138c9 100644 --- a/examples/demo-react-native/android/gradle/wrapper/gradle-wrapper.properties +++ b/examples/demo-react-native/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/examples/demo-react-native/android/settings.gradle b/examples/demo-react-native/android/settings.gradle index fb6bbf47c1..813abd253e 100644 --- a/examples/demo-react-native/android/settings.gradle +++ b/examples/demo-react-native/android/settings.gradle @@ -1,16 +1,6 @@ -apply from: '../../../detox/android/rninfo.gradle' +pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } +plugins { id("com.facebook.react.settings") } +extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } +includeBuild('../node_modules/@react-native/gradle-plugin') rootProject.name = 'DetoxRNExample' - include ':app' - -println("[settings] RNInfo: detected React Native version: (major=${ext.rnInfo.version})") - -if (ext.rnInfo.isRN72OrHigher) { - includeBuild('../node_modules/@react-native/gradle-plugin') -} else { - includeBuild('../node_modules/react-native-gradle-plugin') -} - - -include ':AsyncStorage' -project(':AsyncStorage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-async-storage/async-storage/android') diff --git a/examples/demo-react-native/ios/example.xcodeproj/project.pbxproj b/examples/demo-react-native/ios/example.xcodeproj/project.pbxproj index f3afd347a6..bf8b29778b 100644 --- a/examples/demo-react-native/ios/example.xcodeproj/project.pbxproj +++ b/examples/demo-react-native/ios/example.xcodeproj/project.pbxproj @@ -228,12 +228,16 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh", "${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle", - "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React-Core_privacy.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/boost/boost_privacy.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-Core_privacy.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/boost_privacy.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -385,6 +389,7 @@ OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; USE_HERMES = false; }; name = Debug; diff --git a/examples/demo-react-native/package.json b/examples/demo-react-native/package.json index 790b47d871..5f2a32ead2 100644 --- a/examples/demo-react-native/package.json +++ b/examples/demo-react-native/package.json @@ -22,25 +22,25 @@ "clean:android": "pushd android && ./gradlew clean && popd" }, "dependencies": { - "@react-native-async-storage/async-storage": "^1.21.0", - "react": "18.2.0", - "react-native": "0.74.6", + "@react-native-async-storage/async-storage": "^2.1.0", + "react": "18.3.1", + "react-native": "0.75.4", "tslib": "^2.0.3" }, "devDependencies": { "@babel/preset-env": "^7.20.0", - "@react-native/babel-preset": "0.74.88", - "@react-native/eslint-config": "0.74.88", - "@react-native/metro-config": "0.74.88", - "@react-native/typescript-config": "0.74.88", - "@tsconfig/react-native": "^2.0.2", + "@react-native/babel-preset": "0.75.4", + "@react-native/eslint-config": "0.75.4", + "@react-native/metro-config": "0.75.4", + "@react-native/typescript-config": "0.75.4", + "@tsconfig/react-native": "^3.0.5", "@types/fs-extra": "^9.0.13", "@types/jest": "^29.2.1", - "@types/react": "^18.2.6", + "@types/react": "^18.3.1", "detox": "^20.28.0", "fs-extra": "^9.1.0", "jest": "^29.6.3", "ts-jest": "^29.0.3", - "typescript": "^5.0.4" + "typescript": "^5.3.3" } } diff --git a/examples/demo-react-native/scripts/postinstall.js b/examples/demo-react-native/scripts/postinstall.js index bf34bab72c..608b656bc3 100644 --- a/examples/demo-react-native/scripts/postinstall.js +++ b/examples/demo-react-native/scripts/postinstall.js @@ -1,6 +1,6 @@ const fs = require('fs-extra'); const cp = require('child_process'); -const { setGradleVersionByRNVersion } = require('detox/scripts/updateGradle'); +const { patchGradleByRNVersion } = require('detox/scripts/updateGradle'); const patchBoostPodspec = () => { const log = message => console.log(`[POST-INSTALL] ${message}`); @@ -39,5 +39,5 @@ function podInstallIfRequired() { console.log('[POST-INSTALL] Running Detox\'s example-app post-install script...'); podInstallIfRequired(); -setGradleVersionByRNVersion(); +patchGradleByRNVersion(); console.log('[POST-INSTALL] Completed!');