From 808f4dfb6bc77456914fd443872094660b42f1b9 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Thu, 4 Nov 2021 18:52:47 -0500 Subject: [PATCH 1/2] fix(android, api31): use api31 compatible transitive androidx deps The activities exported by the libraries in the updated dependency versions correctly specify "android:exported" attributes, so apps that use Detox may successfully bump their targetSdkVersion to 31 --- detox/android/detox/build.gradle | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/detox/android/detox/build.gradle b/detox/android/detox/build.gradle index 8bef864444..797767f764 100644 --- a/detox/android/detox/build.gradle +++ b/detox/android/detox/build.gradle @@ -83,15 +83,15 @@ dependencies { // All are aligned with this release: https://developer.android.com/jetpack/androidx/releases/test#1.2.0 dependencies { - // Versions are in-sync with the 'androidx-test-1.2.0' release/tag of the android-test github repo, - // used by the Detox generator. See https://github.com/android/android-test/releases/tag/androidx-test-1.2.0 + // Versions are in-sync with the 'androidx-test-1.4.0' release/tag of the android-test github repo, + // used by the Detox generator. See https://github.com/android/android-test/releases/tag/androidx-test-1.4.0 // Important: Should remain so when generator tag is replaced! - api('androidx.test.espresso:espresso-core:3.3.0') { // Needed all across Detox but also makes Espresso seamlessly provided to Detox users with hybrid apps/E2E-tests. + api('androidx.test.espresso:espresso-core:3.4.0') { // Needed all across Detox but also makes Espresso seamlessly provided to Detox users with hybrid apps/E2E-tests. exclude group: 'com.google.code.findbugs', module: 'jsr305' } - api 'androidx.test.espresso:espresso-web:3.3.0' // Web-View testing - api 'androidx.test:rules:1.2.0' // Needed because of ActivityTestRule. Needed by users *and* internally used by Detox. - api 'androidx.test.ext:junit:1.1.1' // Needed so as to seamlessly provide AndroidJUnit4 to Detox users. Depends on junit core. + api 'androidx.test.espresso:espresso-web:3.4.0' // Web-View testing + api 'androidx.test:rules:1.4.0' // Needed because of ActivityTestRule. Needed by users *and* internally used by Detox. + api 'androidx.test.ext:junit:1.1.3' // Needed so as to seamlessly provide AndroidJUnit4 to Detox users. Depends on junit core. // Version is the latest; Cannot sync with the Github repo (e.g. android/android-test) because the androidx // packaging version of associated classes is simply not there... From 6c51e7926dc7c0b1ea90a36cc2c0b03d949a80c1 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Thu, 4 Nov 2021 19:22:58 -0500 Subject: [PATCH 2/2] build(android, deps): use more recent gradle plugin for rn<64 previously the android gradle plugin in use for tests would be 3.4.x for early react-native versions, but that appears to be incompatible with modern test deps needed for Android 12 3.6.x is the oldest compatible version of the plugin --- detox/test/android/build.gradle | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/detox/test/android/build.gradle b/detox/test/android/build.gradle index cb5378c5c5..7b910624fc 100644 --- a/detox/test/android/build.gradle +++ b/detox/test/android/build.gradle @@ -4,9 +4,7 @@ buildscript { def androidGradlePluginVersion = rnInfo.isRN64OrHigher ? '4.1.0' - : rnInfo.isRN62OrHigher - ? '3.5.3' - : '3.4.2' + : '3.6.4' println "[$project] Resorted to Android Gradle-plugin version $androidGradlePluginVersion" ext {