Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alizeec opened this issue Jun 23, 2021 · 35 comments
Closed

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

alizeec opened this issue Jun 23, 2021 · 35 comments
Labels
duplicate This issue or pull request already exists

Comments

@alizeec
Copy link

alizeec commented Jun 23, 2021

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/[email protected]
        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/[email protected]
        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 ychescale9 added the duplicate This issue or pull request already exists label Jun 23, 2021
@ychescale9
Copy link
Member

Please see #160

@alizeec
Copy link
Author

alizeec commented Jun 23, 2021

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

Thanks

@ychescale9
Copy link
Member

Could you share your full build log please?

@ychescale9 ychescale9 reopened this Jun 23, 2021
@alizeec
Copy link
Author

alizeec commented Jun 23, 2021

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
Copy link
Member

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

@alizeec
Copy link
Author

alizeec commented Jun 23, 2021

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
Copy link
Member

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

@alizeec
Copy link
Author

alizeec commented Jun 23, 2021

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
Copy link
Member

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

@AaronMT
Copy link

AaronMT commented Jun 23, 2021

+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
Copy link
Author

alizeec commented Jun 24, 2021

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
Copy link

facing the same issue, any solution?

@ychescale9
Copy link
Member

@alizeec
Copy link
Author

alizeec commented Jun 24, 2021

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
Copy link

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
Copy link
Member

Thanks for the repo I'll take a look

@tomcashman
Copy link

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
Copy link

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

@ychescale9
Copy link
Member

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
Copy link
Author

alizeec commented Jun 25, 2021

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
Copy link

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

@alizeec
Copy link
Author

alizeec commented Jun 28, 2021

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

@JJ
Copy link

JJ commented Mar 7, 2022

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

@ferraridamiano
Copy link

I solved by lowering the API level to 29

megadeth10 pushed a commit to megadeth10/Github_Test_Application that referenced this issue Jun 22, 2022
megadeth10 pushed a commit to megadeth10/Github_Test_Application that referenced this issue Jun 22, 2022
@takameyer
Copy link

takameyer commented Aug 1, 2022

@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
Copy link

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
Copy link

thanks

@toutpuissantged
Copy link

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
Copy link

Where did you put these commands ? @toutpuissantged

@abdullahceylan
Copy link

You need to run them through the terminal.

@ebragaparah
Copy link

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

@mrcoles
Copy link

mrcoles commented Oct 11, 2023

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
Copy link

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

@Bhuvanaarkala07
Copy link

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,

  • name: create AVD and generate snapshot for caching
    if: steps.avd-cache.outputs.cache-hit != 'true'
    uses: reactivecircus/android-emulator-runner@v2
    with:
    api-level: 29
    force-avd-creation: false
    emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
    disable-animations: false
    script: echo "Generated AVD snapshot for caching."

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

@Bhuvanaarkala07
Copy link

Bhuvanaarkala07 commented May 5, 2024

Team,

Any update on this?
Iam getting this eevrytime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests