diff --git a/.detoxrc.js b/.detoxrc.js index e101afa5b..cf3fc2ae0 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -24,13 +24,13 @@ module.exports = { }, 'android.debug': { type: 'android.apk', - binaryPath: 'android/app/build/outputs/apk/debug/app-experimental-play-debug.apk', + binaryPath: 'android/app/build/outputs/apk/experimentalPlay/debug/app-experimental-play-debug.apk', build: 'cd android ; ./gradlew assembleExperimentalPlayDebug assembleAndroidTest -DtestBuildType=debug ; cd -', reversePorts: [8081] }, 'android.release': { type: 'android.apk', - binaryPath: 'android/app/build/outputs/apk/release/app-experimental-play-release.apk', + binaryPath: 'android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk', build: 'cd android ; ./gradlew assembleExperimentalPlayRelease assembleAndroidTest -DtestBuildType=release ; cd -' } }, @@ -50,7 +50,7 @@ module.exports = { emulator: { type: 'android.emulator', device: { - avdName: 'Pixel_3a_API_30_x86' + avdName: 'Pixel_4_XL_API_31' } } }, diff --git a/android/app/build.gradle b/android/app/build.gradle index 8b0f1de41..1ae47ab8b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -250,6 +250,7 @@ android { release { minifyEnabled enableProguardInReleaseBuilds setProguardFiles([getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro']) + proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro" signingConfig signingConfigs.release if (!isFoss) { firebaseCrashlytics { @@ -280,10 +281,6 @@ android { dimension = "app" buildConfigField "boolean", "IS_OFFICIAL", "false" } - e2e { - dimension = "app" - buildConfigField "boolean", "IS_OFFICIAL", "false" - } foss { dimension = "type" buildConfigField "boolean", "FDROID_BUILD", "true" @@ -311,16 +308,6 @@ android { java.srcDirs = ['src/main/java', 'src/play/java'] manifest.srcFile 'src/play/AndroidManifest.xml' } - e2ePlayDebug { - java.srcDirs = ['src/main/java', 'src/play/java'] - res.srcDirs = ['src/experimental/res'] - manifest.srcFile 'src/play/AndroidManifest.xml' - } - e2ePlayRelease { - java.srcDirs = ['src/main/java', 'src/play/java'] - res.srcDirs = ['src/experimental/res'] - manifest.srcFile 'src/play/AndroidManifest.xml' - } } applicationVariants.all { variant -> @@ -385,8 +372,8 @@ dependencies { implementation "com.github.bumptech.glide:glide:4.9.0" annotationProcessor "com.github.bumptech.glide:compiler:4.9.0" implementation "com.tencent:mmkv-static:1.2.10" - androidTestImplementation('com.wix:detox:+') { transitive = true } - androidTestImplementation 'junit:junit:4.12' + androidTestImplementation('com.wix:detox:+') + implementation 'androidx.appcompat:appcompat:1.1.0' } if (isNewArchitectureEnabled()) { diff --git a/android/app/src/e2e/res/xml/network_security_config.xml b/android/app/src/e2e/res/xml/network_security_config.xml index 95aaf3c17..349e60ae5 100644 --- a/android/app/src/e2e/res/xml/network_security_config.xml +++ b/android/app/src/e2e/res/xml/network_security_config.xml @@ -7,4 +7,8 @@ tools:ignore="AcceptsUserCertificates" /> + + 10.0.2.2 + localhost + \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index b05e6a6f1..ff152b041 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,9 +1,5 @@ import org.apache.tools.ant.taskdefs.condition.Os -def safeExtGet(prop, fallback) { - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback -} - // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { def taskRequests = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase() @@ -75,5 +71,38 @@ allprojects { google() maven { url 'https://maven.google.com' } maven { url 'https://www.jitpack.io' } + + // https://stackoverflow.com/a/74333788/5447468 + // TODO: remove once we update RN + exclusiveContent { + // We get React Native's Android binaries exclusively through npm, + // from a local Maven repo inside node_modules/react-native/. + // (The use of exclusiveContent prevents looking elsewhere like Maven Central + // and potentially getting a wrong version.) + filter { + includeGroup "com.facebook.react" + } + forRepository { + maven { + // NOTE: if you are in a monorepo, you may have "$rootDir/../../../node_modules/react-native/android" + url "$rootDir/../node_modules/react-native/android" + } + } + } + } +} + +subprojects { subproject -> + afterEvaluate { + if (!project.name.equalsIgnoreCase("app") && project.hasProperty("android")) { + android { + compileSdkVersion 31 + buildToolsVersion "31.0.0" + defaultConfig { + minSdkVersion 23 + targetSdkVersion 31 + } + } + } } } \ No newline at end of file diff --git a/e2e/jest.config.js b/e2e/jest.config.js index ab407ce12..7e42435bc 100644 --- a/e2e/jest.config.js +++ b/e2e/jest.config.js @@ -8,6 +8,5 @@ module.exports = { globalTeardown: 'detox/runners/jest/globalTeardown', reporters: ['detox/runners/jest/reporter'], testEnvironment: 'detox/runners/jest/testEnvironment', - verbose: true, - bail: 1 + verbose: true }; diff --git a/patches/expo-av+11.2.3.patch b/patches/expo-av+11.2.3.patch index 63f452970..7ef62e905 100644 --- a/patches/expo-av+11.2.3.patch +++ b/patches/expo-av+11.2.3.patch @@ -1,3 +1,16 @@ +diff --git a/node_modules/expo-av/android/build.gradle b/node_modules/expo-av/android/build.gradle +index e6e3424..f1a6ddc 100644 +--- a/node_modules/expo-av/android/build.gradle ++++ b/node_modules/expo-av/android/build.gradle +@@ -113,7 +113,7 @@ android { + packagingOptions { + // Gradle will add cmake target dependencies into packaging. + // Theses files are intermediated linking files to build reanimated and should not be in final package. +- excludes = [ ++ excludes += [ + "**/libc++_shared.so", + "**/libreactnativejni.so", + "**/libglog.so", diff --git a/node_modules/expo-av/android/src/main/java/expo/modules/av/player/datasource/SharedCookiesDataSourceFactory.java b/node_modules/expo-av/android/src/main/java/expo/modules/av/player/datasource/SharedCookiesDataSourceFactory.java index 19818bc..ae4f631 100644 --- a/node_modules/expo-av/android/src/main/java/expo/modules/av/player/datasource/SharedCookiesDataSourceFactory.java