diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 941bf3d3a..299d58a92 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -203,6 +203,30 @@ jobs: emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none script: ./gradlew connectedDemoDebugAndroidTest --daemon + # Workaround for https://github.com/ReactiveCircus/android-emulator-runner/issues/391 + # From https://github.com/TWiStErRob/github-workflows/blob/main/.github/workflows/instrumentation.yml + - name: "Workaround for emulator bug." + id: script + env: + SCRIPT: | + # Workaround for https://github.com/ReactiveCircus/android-emulator-runner/issues/373 + pre_terminate_crashpad() { + # For some reason pgrep/pkill sees only crashpad_handle, not crashpad_handler, + # but it's definitely called ${ANDROID_HOME}/emulator/crashpad_handler. + + # Best-effort gracefully terminate all crashpad_handler processes. + pkill --exact --echo --signal SIGTERM crashpad_handle || return + sleep 10 + pkill --exact --echo --signal SIGKILL crashpad_handle || return + } + trap pre_terminate_crashpad EXIT + + ${{ inputs.script }} + run: | + script_file="${RUNNER_TEMP}/reactivecircus-android-emulator-runner-prepared-script.sh" + echo "${SCRIPT}" > "${script_file}" + echo "file=${script_file}" >> "${GITHUB_OUTPUT}" + - name: Prevent pushing new screenshots if this is a fork (instrumented) id: checkfork_screenshots_instrumented continue-on-error: false diff --git a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt index ceae429d5..4308796ce 100644 --- a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt +++ b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/EdgeToEdgeTest.kt @@ -88,17 +88,17 @@ class EdgeToEdgeTest { } @RequiresDisplay(WidthSizeClassEnum.COMPACT, HeightSizeClassEnum.MEDIUM) - @SdkSuppress(minSdkVersion = 26, maxSdkVersion = 26) + @SdkSuppress(minSdkVersion = 27, maxSdkVersion = 27) @Test - fun edgeToEdge_Phone_Api26() { - testEdgeToEdge("edgeToEdge_Phone_Api26") + fun edgeToEdge_Phone_Api27() { + testEdgeToEdge("edgeToEdge_Phone_Api27") } @RequiresDisplay(WidthSizeClassEnum.COMPACT, HeightSizeClassEnum.MEDIUM) - @SdkSuppress(minSdkVersion = 30, maxSdkVersion = 30) + @SdkSuppress(minSdkVersion = 31, maxSdkVersion = 31) @Test - fun edgeToEdge_Phone_Api30() { - testEdgeToEdge("edgeToEdge_Phone_Api30") + fun edgeToEdge_Phone_Api31() { + testEdgeToEdge("edgeToEdge_Phone_Api31") } @RequiresDisplay(WidthSizeClassEnum.EXPANDED, HeightSizeClassEnum.MEDIUM) diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/GradleManagedDevices.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/GradleManagedDevices.kt index f67e9093d..f6a599cd2 100644 --- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/GradleManagedDevices.kt +++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/GradleManagedDevices.kt @@ -27,12 +27,12 @@ import org.gradle.kotlin.dsl.invoke internal fun configureGradleManagedDevices( commonExtension: CommonExtension<*, *, *, *, *, *>, ) { - val pixel4 = DeviceConfig("Pixel 4", 30, "aosp-atd") + val pixel4 = DeviceConfig("Pixel 4", 27, "aosp") val pixel6 = DeviceConfig("Pixel 6", 31, "aosp") - val pixelC = DeviceConfig("Pixel C", 30, "aosp-atd") + val pixelC = DeviceConfig("Pixel C", 30, "aosp") val allDevices = listOf(pixel4, pixel6, pixelC) - val ciDevices = listOf(pixel4, pixelC) + val ciDevices = listOf(pixel4, pixel6, pixelC) commonExtension.testOptions { managedDevices { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 740baa0cc..0b44d9841 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ accompanist = "0.34.0" androidDesugarJdkLibs = "2.0.4" # AGP and tools should be updated together -androidGradlePlugin = "8.4.0" +androidGradlePlugin = "8.4.1" androidTools = "31.4.0" androidxActivity = "1.8.2" androidxAppCompat = "1.6.1"