Malinskiy / action-android

Collection of Android-related GitHub Actions
MIT License
185 stars 24 forks source link

Starting emulator with API=31, TAG=google_apis and ABI=x86... #50

Closed hannesa2 closed 3 years ago

hannesa2 commented 3 years ago

I did a test with api 31 but I run into

Starting emulator with API=31, TAG=google_apis and ABI=x86...
ANDROID_HOME is /Users/runner/android-sdk
PATH is /Users/runner/hostedtoolcache/Java_Adopt_jdk/11.0.12-7/x64/Contents/Home/bin:/Users/runner/android-sdk/cmdline-tools/latest/bin:/Users/runner/android-sdk/cmdline-tools/bootstrap-version/bin:/Users/runner/android-sdk/bin:/Users/runner/android-sdk/platform-tools:/Users/runner/android-sdk/platform-tools/bin:/Users/runner/hostedtoolcache/Java_Adopt_jdk/11.0.12-7/x64/Contents/Home/bin:/usr/local/lib/ruby/gems/2.7.0/bin:/usr/local/opt/ruby@2.7/bin:/usr/local/opt/pipx_bin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools:/Users/runner/.ghcup/bin:/Users/runner/hostedtoolcache/stack/2.7.3/x64
bash -c \/Users/runner/android-sdk/cmdline-tools/bootstrap-version/bin/sdkmanager emulator 'cmdline-tools;latest' platform-tools 'system-images;android-31;google_apis;x86' > /dev/null
Warning: Failed to find package 'system-images;android-31;google_apis;x86'
Error: The process 'bash' failed with exit code 1
    at ExecState._setResult (/Users/runner/work/_actions/malinskiy/action-android/release/0.1.2/emulator-run-cmd/node_modules/@actions/exec/lib/toolrunner.js:548:25)
    at ExecState.CheckComplete (/Users/runner/work/_actions/malinskiy/action-android/release/0.1.2/emulator-run-cmd/node_modules/@actions/exec/lib/toolrunner.js:531:18)
    at ChildProcess.<anonymous> (/Users/runner/work/_actions/malinskiy/action-android/release/0.1.2/emulator-run-cmd/node_modules/@actions/exec/lib/toolrunner.js:431:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)
Error: The process 'bash' failed with exit code 1

Here is the complete job https://github.com/hannesa2/paho.mqtt.android/pull/215/checks?check_run_id=3802053628

It should work, or ?

image
Malinskiy commented 3 years ago

Hey @hannesa2, thanks for submitting the issue.

I believe there is no x86 flavor of 31, only “ system-images;android-31;google_apis;x86_64” so you have to specify “abi: x86_64”

hannesa2 commented 3 years ago

Sadly it's crashing

Malinskiy commented 3 years ago

I believe the system UI is not responding on your build image

Perhaps there is something that could be done in the test to handle slow devices?

Alternatively I suggest passing the number of cores and memory explicitly to the emulator similar to https://github.com/Malinskiy/adam/blob/eec940e186bf9bd852cb2d39ffc765aaed2594ee/.github/workflows/ci.yaml#L53

hannesa2 commented 3 years ago

I was not able to locate error exactly, but I changed something in code and now it works at least once. But I needed several retries.

Thanks for you hints ❤️