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

config.ini: No such file or directory

Open soriyathach opened this issue 4 years ago • 3 comments

I have a CI worklow using android-emulator-runner@v2, it was working well until the last update I think (2.15.0). I am getting now this error :

/bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'google_apis/x86' --package 'system-images;android-30;google_apis;x86' --device 'Nexus 6'
Loading local repository...                                                     
[=========                              ] 25% Loading local repository...       
[=========                              ] 25% Fetch remote repository...        
[=======================================] 100% Fetch remote repository...       
/bin/sh -c \printf 'hw.cpu.ncore=2
' >> ~/.android/avd/test.avd/config.ini
/bin/sh: line 1: /Users/soriya-x64/.android/avd/test.avd/config.ini: No such file or directory
/Users/soriya-x64/android-sdk/platform-tools/adb -s emulator-5554 emu kill
OK: killing emulator, bye bye
OK

It seems to be linked to this commit : https://github.com/ReactiveCircus/android-emulator-runner/pull/130. My build is working correctly if I force the version back to 2.14.3.

soriyathach avatar Mar 22 '21 15:03 soriyathach

Looks like you're using a self-hosted runner? can you confirm if /Users/soriya-x64/.android/avd/test.avd exist? It would also help if you could share the logs for a successful build (with 2.14.3) :)

ychescale9 avatar Mar 22 '21 23:03 ychescale9

Yep, self-hosted runner on a macbook x64. I wasn't able to see if the emulator has correctly been created, the .android folder is always deleted at the end of the flow. For me the issue is at this moment : https://github.com/ReactiveCircus/android-emulator-runner/blob/27a0759d85db82201dba22f1cddcfd5dbfeaec20/src/emulator-manager.ts#L28.

Here is the log at the same moment for 2.14.3 :

/bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'google_apis/x86' --package 'system-images;android-30;google_apis;x86' --device 'Nexus 6'
Loading local repository...                                                     
[=========                              ] 25% Loading local repository...       
[=========                              ] 25% Fetch remote repository...        
[=======================================] 100% Fetch remote repository...       
Starting emulator.
/bin/sh -c \/Users/soriya-x64/android-sdk/emulator/emulator -avd test -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim &
handleCpuAcceleration: feature check for hvf
cannot add library /Users/soriya-x64/android-sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed
added library /Users/soriya-x64/android-sdk/emulator/lib64/vulkan/libvulkan.dylib
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
emulator: INFO: GrpcServices.cpp:301: Started GRPC server at 127.0.0.1:8554, security: Local
emulator: Cold boot: requested by the user

soriyathach avatar Mar 22 '21 23:03 soriyathach

New user of this library here, getting the same error. (Also on a self-hosted runner).

Logs for v2:

Creating AVD.
/bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'default/x86' --package 'system-images;android-29;default;x86' --device 'pixel_2'
Loading local repository...                                                     
[=========                              ] 25% Loading local repository...       
[=========                              ] 25% Fetch remote repository...        
[=======================================] 100% Fetch remote repository...       
/bin/sh -c \printf 'hw.cpu.ncore=2
' >> ~/.android/avd/test.avd/config.ini
/bin/sh: line 1: /Users/jenkins/.android/avd/test.avd/config.ini: No such file or directory
/Users/jenkins/android-sdk/platform-tools/adb -s emulator-5554 emu kill
error: could not connect to TCP port 5554: Connection refused
The process '/Users/jenkins/android-sdk/platform-tools/adb' failed with exit code 1
Error: The process '/bin/sh' failed with exit code 1

I don't see the .android folder at all but maybe it's deleted after the action finishes. Would it make sense to add an option to keep the emulator instead of deleting it?

Because @soriyathach mentioned that 2.14.3 used to work, I downgraded to that version and the emulator booted.

jacobras avatar Jun 03 '21 20:06 jacobras

Check out #197 for a workaround

mrk-han avatar Nov 02 '22 04:11 mrk-han