ReactiveCircus / android-emulator-runner

A GitHub Action for installing, configuring and running hardware-accelerated Android Emulators on macOS virtual machines.
Apache License 2.0
977 stars 193 forks source link

Cannot get arm64 emulator up and running on ubuntu-latest #377

Open AngelDev06 opened 9 months ago

AngelDev06 commented 9 months ago

What I get is the following:

  INFO    | Android emulator version 33.1.24.0 (build_id 11237101) (CL:N/A)
  INFO    | Found systemPath /usr/local/lib/android/sdk/system-images/android-24/default/arm[64](https://github.com/AngelDev06/AlterHook/actions/runs/7774797878/job/21200016640#step:8:67)-v8a/
  WARNING | encryption is off
  WARNING | FeatureControl is requesting a non existing feature.
  ERROR   | Unable to connect to adb daemon on port: 5037
  I0204 14:42:16.9[66](https://github.com/AngelDev06/AlterHook/actions/runs/7774797878/job/21200016640#step:8:69)798    2911 HealthMonitor.cpp:279] HealthMonitor disabled.
  I0204 14:42:16.977539    2911 FrameBuffer.cpp:486] Graphics Adapter Vendor Google (Google Inc.)
  I0204 14:42:16.977558    2911 FrameBuffer.cpp:487] Graphics Adapter Android Emulator OpenGL ES Translator (Google SwiftShader)
  I0204 14:42:16.9775[69](https://github.com/AngelDev06/AlterHook/actions/runs/7774797878/job/21200016640#step:8:72)    2911 FrameBuffer.cpp:488] Graphics API Version OpenGL ES 3.0 (OpenGL ES 3.0 SwiftShader 4.0.0.1)
  I0204 14:42:16.977576    2911 FrameBuffer.cpp:489] Graphics API Extensions GL_OES_EGL_sync GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_standard_derivatives GL_OES_texture_npot GL_OES_rgb8_rgba8 GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_texture_format_BGRA8888 GL_APPLE_texture_format_BGRA8888 
  I0204 14:42:16.977584    2911 FrameBuffer.cpp:490] Graphics Device Extensions N/A
  WARNING: cannnot unmap ptr 0x7fb1f7bf5000 as it is in the protected range from 0x7fb1f7bf5000 to 0x7fb237df5000
  WARNING: cannnot unmap ptr 0x7fb237c01000 as it is in the protected range from 0x7fb1f7bf5000 to 0x7fb237df5000
  WARNING | The emulator now requires a signed jwt token for gRPC access! Use the -grpc flag if you really want an open unprotected grpc port
  INFO    | Storing crashdata in: , detection is enabled for process: 2911
  INFO    | Duplicate loglines will be removed, if you wish to see each individual line launch with the -log-nofilter flag.
  INFO    | Increasing RAM size to 1024MB
  library_mode swiftshader_indirect gpu mode swiftshader_indirect
  INFO    | Using security allow list from: /usr/local/lib/android/sdk/emulator/lib/emulator_access.json
  WARNING | *** Basic token auth should only be used by android-studio ***
  INFO    | The active JSON Web Key Sets can be found here: /run/user/1001/avd/running/2911/jwks/93f8c2dd-0b0b-46a5-9cab-2c42bc8[71](https://github.com/AngelDev06/AlterHook/actions/runs/7774797878/job/21200016640#step:8:74)f5f/active.jwk
  INFO    | Scanning /run/user/1001/avd/running/2911/jwks/93f8c2dd-0b0b-46a5-9cab-2c42bc871f5f for jwk keys.
  INFO    | Started GRPC server at 127.0.0.1:8554, security: Local, auth: +token
  INFO    | Advertising in: /run/user/1001/avd/running/pid_2911.ini
  [2915:2915:20240204,144217.01[84](https://github.com/AngelDev06/AlterHook/actions/runs/7774797878/job/21200016640#step:8:87)43:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
  [2915:2915:20240204,144217.0184[88](https://github.com/AngelDev06/AlterHook/actions/runs/7774797878/job/21200016640#step:8:91):ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
  /usr/local/lib/android/sdk/platform-tools/adb shell getprop sys.boot_completed
  * daemon not running; starting now at tcp:5037
  * daemon started successfully
  adb: no devices/emulators found
  The process '/usr/local/lib/android/sdk/platform-tools/adb' failed with exit code 1
  /usr/local/lib/android/sdk/platform-tools/adb shell getprop sys.boot_completed
  ^ keeps repeating the above till timeout...

I have 0 clue what's going on, I might be missing a package or something? I have initialized the action like this:

uses: ReactiveCircus/android-emulator-runner@v2.30.1
with:
  arch: arm64-v8a
  api-level: 24
  script: ./scripts/android-run-tests.sh ${{ steps.strings.outputs.cmake-preset }}
LinX64 commented 9 months ago

Okay, so I went deep, and the problem seemed to be the issue with enough space on the OS. If you clear the caches, it will work.

rayworks commented 5 months ago

Hi @AngelDev06 , I've also come across the emulator startup issue recently.

You can check the shell script ./scripts/android-run-tests.sh. Before checking the property by adb shell getprop sys.boot_completed, is there a command adb wait-for-device out there to wait for device state change ?

lucasmacedot commented 4 months ago

What cache you cleaned? The GH one? How did you clean it?

lydavid-oncallhealth commented 3 months ago

I cleared space on GHA with something like this: https://github.com/android/nowinandroid/blob/420076f01aadd61f650b6848cd23643ca59226b8/.github/workflows/Build.yaml#L159-L168