ReactiveCircus / android-emulator-runner

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

could not connect to TCP port 5554: Connection refused #161

Closed alizeec closed 3 years ago

alizeec commented 3 years ago

Hello

I have an error when I try to start an emulator. My workflow is

name: Generate screenshots

on: [pull_request]

jobs:
  screenshots:
    name: Generate screenshots
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2

     - name: Set up JDK 11
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: '11'
      - name: Cache Gradle packages
        uses: actions/cache@v2.1.6
        with:
          path: |
            ~/.gradle/caches
            .gradle
          key: ${{ runner.os }}-gradle-quality-${{ hashFiles('**/*.gradle.kts') }}
          restore-keys: |
            ${{ runner.os }}-gradle-quality-
      - name: Cache Gradle wrapper
        uses: actions/cache@v2.1.6
        with:
          path: ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradlew') }}
          restore-keys: |
            ${{ runner.os }}-gradle-wrapper-
      - uses: actions/setup-ruby@v1
        with:
          ruby-version: '2.6'
          bundler-cache: true
      - name: create AVD
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 28
          target: default
          arch: x86
          profile: Nexus 6
          emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          disable-animations: true
          script: echo "Generated AVD."

and the error

/Users/runner/android-sdk/platform-tools/adb -s emulator-5554 emu kill
error: could not connect to TCP port 5554: Connection refused
The process '/Users/runner/android-sdk/platform-tools/adb' failed with exit code 1
Error: The process '/bin/sh' failed with exit code 1

Thanks!

ychescale9 commented 3 years ago

Please see https://github.com/ReactiveCircus/android-emulator-runner/issues/160

alizeec commented 3 years ago

this is not the same error. Also I tried with runs-on: macos-11 and emulator-build: 6110076 it doesnt' help

Thanks

ychescale9 commented 3 years ago

Could you share your full build log please?

alizeec commented 3 years ago

sure

Run reactivecircus/android-emulator-runner@v2
  with:
    api-level: 28
    target: default
    arch: x86
    profile: Nexus 6
    emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
    disable-animations: true
    emulator-build: 6110076
    script: echo "Generated AVD."
    cores: 2
    avd-name: test
    force-avd-creation: true
    disable-spellchecker: false
    disable-linux-hw-accel: true
  env:
    JAVA_HOME: /Users/runner/hostedtoolcache/Java_Adopt_jdk/11.0.11-9/x64/Contents/Home
API level: 28
target: default
CPU architecture: x86
Hardware profile: Nexus 6
Cores: 2
SD card path or size: 
AVD name: test
force avd creation: true
emulator options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable animations: true
disable spellchecker: false
disable Linux hardware acceleration: true
using emulator build: 6110076
Script:
echo "Generated AVD."
Installing latest build tools, platform tools, and platform.
/bin/sh -c \sdkmanager --install 'build-tools;30.0.3' platform-tools 'platforms;android-28' > /dev/null
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Installing emulator build 6110076.
/usr/local/opt/curl/bin/curl -fo emulator.zip https://dl.google.com/android/repository/emulator-darwin-6110076.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0  316M    0 13451    0     0   180k      0  0:29:59 --:--:--  0:29:59  196k
 25  316M   25 80.4M    0     0  75.8M      0  0:00:04  0:00:01  0:00:03 76.2M
 50  316M   50  159M    0     0  76.9M      0  0:00:04  0:00:02  0:00:02 77.1M
 70  316M   70  224M    0     0  73.2M      0  0:00:04  0:00:03  0:00:01 73.3M
 97  316M   97  308M    0     0  75.7M      0  0:00:04  0:00:04 --:--:-- 75.8M
100  316M  100  316M    0     0  76.1M      0  0:00:04  0:00:04 --:--:-- 77.4M
/usr/bin/unzip -q emulator.zip -d /Users/runner/Library/Android/sdk
Installing system images.
/bin/sh -c \sdkmanager --install 'system-images;android-28;default;x86' > /dev/null
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Creating AVD.
/bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'default/x86' --package 'system-images;android-28;default;x86' --device 'Nexus 6'
Loading local repository...                                                     
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
[=========                              ] 25% Loading local repository...       
[=========                              ] 25% Fetch remote repository...        
[=======================================] 100% Fetch remote repository...       
Error: "emulator" package must be installed!
null
/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 emu kill
error: could not connect to TCP port 5554: Connection refused
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
Error: The process '/bin/sh' failed with exit code 1

but I think this issue could be closed because even if it's not the same error, it seems related to #160

ychescale9 commented 3 years ago

Are you using a self hosted runner? This looks like a different issue as it fails while trying to creat the avd.

alizeec commented 3 years ago

Are you using a self hosted runner? This looks like a different issue as it fails while trying to creat the avd.

no I'm not

ychescale9 commented 3 years ago

Was it working before? Have tried with only api-level, script and nothing else?

alizeec commented 3 years ago

Was it working before? Have tried with only api-level, script and nothing else?

with only api-leveland script I have

Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Installing system images.
/bin/sh -c \sdkmanager --install 'system-images;android-28;default;x86' > /dev/null
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Creating AVD.
/bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'default/x86' --package 'system-images;android-28;default;x86'
Loading local repository...                                                     
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
[=========                              ] 25% Loading local repository...       
[=========                              ] 25% Fetch remote repository...        
[=======================================] 100% Fetch remote repository...       
sh to create a custom hardware profile? [no] [command]/bin/sh -c \printf 'hw.cpu.ncore=2
' >> /Users/runner/.android/avd/test.avd/config.ini
Starting emulator.
/bin/sh -c \/Users/runner/Library/Android/sdk/emulator/emulator -avd test -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim &
handleCpuAcceleration: feature check for hvf
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
cannot add library /Users/runner/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed
emulator: WARNING: Running on a system with less than 6 logical cores. Setting number of virtual cores to 1
emulator: feeding guest with passive gps data, in headless mode
added library /Users/runner/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib
emulator: ### WARNING: /etc/localtime does not point to zoneinfo-compatible timezone name

emulator: INFO: GrpcServices.cpp:315: Started GRPC server at 127.0.0.1:8554, security: Local
emulator: INFO: EmulatorAdvertisement.cpp:93: Advertising in: /Users/runner/Library/Caches/TemporaryItems/avd/running/pid_1413.ini
emulator: Cold boot: requested by the user
dyld: lazy symbol binding failed: Symbol not found: _preadv
  Referenced from: /Users/runner/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64-headless
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _preadv
  Referenced from: /Users/runner/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64-headless
  Expected in: /usr/lib/libSystem.B.dylib

/Users/runner/Library/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 '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
/Users/runner/Library/Android/sdk/platform-tools/adb shell getprop sys.boot_completed
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
adb: no devices/emulators found
/Users/runner/Library/Android/sdk/platform-tools/adb shell getprop sys.boot_completed
adb: no devices/emulators found
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
/Users/runner/Library/Android/sdk/platform-tools/adb shell getprop sys.boot_completed
adb: no devices/emulators found
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
/Users/runner/Library/Android/sdk/platform-tools/adb shell getprop sys.boot_completed
adb: no devices/emulators found
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
/Users/runner/Library/Android/sdk/platform-tools/adb shell getprop sys.boot_completed
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
adb: no devices/emulators found
/Users/runner/Library/Android/sdk/platform-tools/adb shell getprop sys.boot_completed
adb: no devices/emulators found
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
/Users/runner/Library/Android/sdk/platform-tools/adb shell getprop sys.boot_completed
adb: no devices/emulators found
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
/Users/runner/Library/Android/sdk/platform-tools/adb shell getprop sys.boot_completed
adb: no devices/emulators found
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1

and then an infinite loop of

/Users/runner/Library/Android/sdk/platform-tools/adb shell getprop sys.boot_completed
adb: no devices/emulators found
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1

I don't know if it was working before, this is the first time I try to use this action

ychescale9 commented 3 years ago

Ok now what if you add just emulator-build: 6110076?

AaronMT commented 3 years ago

+1 happened today in a run https://github.com/mozilla-mobile/fenix/pull/20134/checks?check_run_id=2896954833

we're just using macos-latest -> workflow

alizeec commented 3 years ago

emulator-build: 6110076

I have the same error than before

API level: 28
target: default
CPU architecture: x86
Hardware profile: 
Cores: 2
SD card path or size: 
AVD name: test
force avd creation: true
emulator options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
disable animations: true
disable spellchecker: false
disable Linux hardware acceleration: true
using emulator build: 6110076
Script:
echo "Generated AVD."
Installing latest build tools, platform tools, and platform.
/bin/sh -c \sdkmanager --install 'build-tools;30.0.3' platform-tools 'platforms;android-28' > /dev/null
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Installing emulator build 6110076.
/usr/local/opt/curl/bin/curl -fo emulator.zip https://dl.google.com/android/repository/emulator-darwin-6110076.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
  3  316M    3 10.0M    0     0  4018k      0  0:01:20  0:00:02  0:01:18 5087k
 12  316M   12 40.0M    0     0  11.0M      0  0:00:28  0:00:03  0:00:25 12.9M
 32  316M   32  103M    0     0  22.9M      0  0:00:13  0:00:04  0:00:09 26.0M
 67  316M   67  212M    0     0  38.3M      0  0:00:08  0:00:05  0:00:03 42.4M
100  316M  100  316M    0     0  49.1M      0  0:00:06  0:00:06 --:--:-- 75.6M
/usr/bin/unzip -q emulator.zip -d /Users/runner/Library/Android/sdk
Installing system images.
/bin/sh -c \sdkmanager --install 'system-images;android-28;default;x86' > /dev/null
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Creating AVD.
/bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'default/x86' --package 'system-images;android-28;default;x86'
Loading local repository...                                                     
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
[=========                              ] 25% Loading local repository...       
[=========                              ] 25% Fetch remote repository...        
[=======================================] 100% Fetch remote repository...       
Do you wish to create a custom hardware profile? [no] Error: "emulator" package must be installed!
null
/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 emu kill
error: could not connect to TCP port 5554: Connection refused
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
Error: The process '/bin/sh' failed with exit code 1

with

 - name: create AVD
  uses: reactivecircus/android-emulator-runner@v2
  with:
    api-level: 28
    emulator-build: 6110076
    script: echo "Generated AVD."
TheReprator commented 3 years ago

facing the same issue, any solution?

ychescale9 commented 3 years ago

I run out of ideas on what your issue might be. Here's a workflow that works with emulator-build: 6110076: https://github.com/ReactiveCircus/streamlined/runs/2895724842?check_suite_focus=true https://github.com/ReactiveCircus/streamlined/blob/02d4bc8a4d9f33ee412f6ade3d0f1a49b3c51a74/.github/workflows/ci.yml#L211-L220

alizeec commented 3 years ago

Even with the same code than yours, it fails on my side

jobs:
  screenshots:
    name: Generate screenshots
    runs-on: macos-latest
    timeout-minutes: 25
    env:
      JAVA_TOOL_OPTIONS: -Xmx4g -XX:+UseParallelGC
      ENABLE_APP_VERSIONING: false

    steps:
      - uses: actions/checkout@v2

      - uses: gradle/wrapper-validation-action@v1

      - uses: actions/setup-java@v2
        with:
          distribution: 'zulu'
          java-version: '15'

      - uses: actions/cache@v2
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
          restore-keys: |
            ${{ runner.os }}-${{ github.job }}-
      - uses: actions/cache@v2
        id: avd-cache
        with:
          path: |
            ~/.android/avd/*
            ~/.android/adb*
          key: avd

      - name: Run Android instrumented tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 23
          arch: x86
          profile: Nexus 5X
          force-avd-creation: false
          emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
          emulator-build: 6110076
          script: echo "Generated AVD snapshot for caching."
 /bin/sh -c \sdkmanager --install 'build-tools;30.0.3' platform-tools 'platforms;android-23' > /dev/null
Picked up JAVA_TOOL_OPTIONS: -Xmx4g -XX:+UseParallelGC
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Installing emulator build 6110076.
/usr/local/opt/curl/bin/curl -fo emulator.zip https://dl.google.com/android/repository/emulator-darwin-6110076.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 13  316M   13 41.3M    0     0   108M      0  0:00:02 --:--:--  0:00:02  109M
 47  316M   47  149M    0     0   108M      0  0:00:02  0:00:01  0:00:01  108M
 85  316M   85  271M    0     0   113M      0  0:00:02  0:00:02 --:--:--  114M
100  316M  100  316M    0     0   114M      0  0:00:02  0:00:02 --:--:--  114M
/usr/bin/unzip -q emulator.zip -d /Users/runner/Library/Android/sdk
Installing system images.
/bin/sh -c \sdkmanager --install 'system-images;android-23;default;x86' > /dev/null
Picked up JAVA_TOOL_OPTIONS: -Xmx4g -XX:+UseParallelGC
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
Creating AVD.
/bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'default/x86' --package 'system-images;android-23;default;x86' --device 'Nexus 5X'
Picked up JAVA_TOOL_OPTIONS: -Xmx4g -XX:+UseParallelGC
Loading local repository...                                                     
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529')
[=========                              ] 25% Loading local repository...       
[=========                              ] 25% Fetch remote repository...        
[=======================================] 100% Fetch remote repository...       
Error: "emulator" package must be installed!
null
/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 emu kill
error: could not connect to TCP port 5554: Connection refused
The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1
Error: The process '/bin/sh' failed with exit code 1
TheReprator commented 3 years ago

Even for me the result is same,

My github action, which i had modified to your as follows in repo: https://github.com/TheReprator/Wipro/blob/master/.github/workflows/android_build.yml

Exception logs: `Run reactivecircus/android-emulator-runner@v2 API level: 23 target: default CPU architecture: x86 Hardware profile: Nexus 5X Cores: 2 SD card path or size: AVD name: test force avd creation: false emulator options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable animations: false disable spellchecker: false disable Linux hardware acceleration: true using emulator build: 6110076 Script: echo "Generated AVD snapshot for caching." Installing latest build tools, platform tools, and platform. /bin/sh -c \sdkmanager --install 'build-tools;30.0.3' platform-tools 'platforms;android-23' > /dev/null Picked up JAVA_TOOL_OPTIONS: -Xmx4g -XX:+UseParallelGC Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529') Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529') Installing emulator build 6110076. /usr/local/opt/curl/bin/curl -fo emulator.zip https://dl.google.com/android/repository/emulator-darwin-6110076.zip % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 7 316M 7 23.4M 0 0 70.4M 0 0:00:04 --:--:-- 0:00:04 72.5M 41 316M 41 130M 0 0 98.0M 0 0:00:03 0:00:01 0:00:02 98.7M 73 316M 73 231M 0 0 99.2M 0 0:00:03 0:00:02 0:00:01 99.6M 100 316M 100 316M 0 0 105M 0 0:00:03 0:00:03 --:--:-- 105M /usr/bin/unzip -q emulator.zip -d /Users/runner/Library/Android/sdk Installing system images. /bin/sh -c \sdkmanager --install 'system-images;android-23;default;x86' > /dev/null Picked up JAVA_TOOL_OPTIONS: -Xmx4g -XX:+UseParallelGC Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529') Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529') Creating AVD. /bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'default/x86' --package 'system-images;android-23;default;x86' --device 'Nexus 5X' Picked up JAVA_TOOL_OPTIONS: -Xmx4g -XX:+UseParallelGC Loading local repository...
Warning: Observed package id 'ndk;21.4.7075529' in inconsistent location '/Users/runner/Library/Android/sdk/ndk-bundle' (Expected '/Users/runner/Library/Android/sdk/ndk/21.4.7075529') [========= ] 25% Loading local repository...
[========= ] 25% Fetch remote repository...
[=======================================] 100% Fetch remote repository...
Error: "emulator" package must be installed! null /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 emu kill error: could not connect to TCP port 5554: Connection refused The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1 Error: The process '/bin/sh' failed with exit code 1`

ychescale9 commented 3 years ago

Thanks for the repo I'll take a look

tomcashman commented 3 years ago

I had the same issue on malinskiy/action-android and swapped to this action to try resolve. So my guess is something on the environments or Google tools has changed.

colinrtwhite commented 3 years ago

@ychescale9 I'm also seeing this in Coil if you want to use that repo to debug.

ychescale9 commented 3 years ago

I just added support for setting modern emulator build ids. Can someone please try again with emulator-build: 7425822 (this is the previous emulator version 30.7.3)?

alizeec commented 3 years ago

It works with emulator-build: 7425822 , I don't have any error 🎉 Thank you so much. I tried with a simple echo for now though, I'll try tomorrow with a script that actually need a device

colinrtwhite commented 3 years ago

@ychescale9 emulator-build: 7425822 works for me! Thanks for the quick fix.

alizeec commented 3 years ago

It doesn't work with API 30 though, we have the same error with API 30

JJ commented 2 years ago

I'm getting this error now. The only way to fix it is to peg an emulator build?

ferraridamiano commented 2 years ago

I solved by lowering the API level to 29

takameyer commented 2 years ago

@ychescale9 We are hitting this crash all the time. Here is my config:

with:
    api-level: 29
    ndk: 21.4.7075529
    cmake: 3.23.2
    target: google_apis
    emulator-build: 7425822
    script: npm run test:android --prefix integration-tests/environments/react-native
    arch: x86
    cores: 2
    avd-name: test
    force-avd-creation: true
    emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
    disable-animations: true
    disable-spellchecker: false
    disable-linux-hw-accel: auto
    enable-hw-keyboard: false
    channel: stable
abdullahceylan commented 2 years ago

I have just met this issue and noticed that it was happening due to the hanging ADB server. Mine has been solved by running the following commands:

adb kill-server

adb start-server

toutpuissantged commented 2 years ago

thanks

toutpuissantged commented 2 years ago

I have just met this issue and noticed that it was happening due to the hanging ADB server. Mine has been solved by running the following commands:

adb kill-server

adb start-server

it's work perfectly

sina-sixwheel commented 2 years ago

Where did you put these commands ? @toutpuissantged

abdullahceylan commented 2 years ago

You need to run them through the terminal.

ebragaparah commented 1 year ago

in which terminal should we run it? I'm not able to find where to put those commands

mrcoles commented 1 year ago

I separately ran into this error using expo & Android:

could not connect to TCP port 5554: Connection refused

I fixed it by finding and stopping the process using port 5555 (I had a docker compose container using it). Unhelpful error message from the Android team.

BisiOlaYemi commented 9 months ago

What if we remove the node_modules and reinstall won't that get the issue solved?

Bhuvanaarkala07 commented 5 months ago

I am getting same error,

Terminate Emulator /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 emu kill error: could not connect to TCP port 5554: Connection refused The process '/Users/runner/Library/Android/sdk/platform-tools/adb' failed with exit code 1 Error: Timeout waiting for emulator to boot.

This is the script we r using,

Please guide how to fix this error. It was working , but started failing recently.

Bhuvanaarkala07 commented 5 months ago

Team,

Any update on this? Iam getting this eevrytime