android-emulator-runner icon indicating copy to clipboard operation
android-emulator-runner copied to clipboard

Getting `Unknown platform error occurred when running the UTP test suite`

Open TimPushkin opened this issue 2 years ago • 1 comments

I run the action like this on macos-latest:

- name: Cache AVD
  uses: actions/cache@v3
  id: avd-cache
  with:
    path: |
      ~/.android/avd/*
      ~/.android/adb*
    key: avd

- name: Create AVD and generate a snapshot for caching
  if: steps.avd-cache.outputs.cache-hit != 'true'
  uses: reactivecircus/android-emulator-runner@v2
  with:
    api-level: 31
    arch: x86_64
    force-avd-creation: false
    emulator-options: -no-audio -no-window -no-boot-anim -camera-back none -camera-front none -gpu swiftshader_indirect
    script: echo "Generated AVD snapshot for caching"

- name: Run instrumented tests
  uses: reactivecircus/android-emulator-runner@v2
  with:
    api-level: 31
    arch: x86_64
    force-avd-creation: false
    emulator-options: -no-audio -no-window -no-snapshot-save -no-boot-anim -camera-back none -camera-front none -gpu swiftshader_indirect
    script: ./gradlew connectedDebugAndroidTest

And get this error, even though the tests run absolutely fine locally:

> Task :app:connectedDebugAndroidTest

Test results saved as file:/Users/runner/work/DepNav/DepNav/app/build/outputs/androidTest-results/connected/test-result.pb. Inspect these results in Android Studio by selecting Run > Import Tests From File from the menu bar and importing test-result.pb.
Unknown platform error occurred when running the UTP test suite. Please check logs for details.

> Task :app:connectedDebugAndroidTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:connectedDebugAndroidTest'.
> There were failing tests. See the report at: file:///Users/runner/work/DepNav/DepNav/app/build/reports/androidTests/connected/index.html

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org/

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 51s
70 actionable tasks: 70 executed
Error: The process '/bin/sh' failed with exit code 1

I tried clearing CI cache, but nothing changed. I also tried using target: google-apis and api-level: 32, but this setup just keeps time-outing.

TimPushkin avatar Aug 20 '22 16:08 TimPushkin

@TimPushkin I had to go into my config.ini and quadrupled the size of my emulator which fixed this. Well, I put the data partition from 800M to 3200M. Had the exact same issue. I think it came after updating to 3.5.0 espresso alpha, my AGP, my gradle and adding testInstrumentationRunnerArguments useTestStorageService: 'true' to my defaultConfig

mrk-han avatar Oct 06 '22 04:10 mrk-han