Cannot launch Android emulator created by AVD Manager on macOS stack

android
#1

I’m trying to run Android emulator on macOS Stack (Visual Studio for Mac, stable).

Unfortunately step AVD Manager fails no matter what kind of emulator is chosen. It fails both for x86 emulators as well as for ARM.

In case of x86 emualtors it fails due to HAXM requirements, but in case of ARM it’s unable to download dependencies.

Sample build that failed: https://app.bitrise.io/build/5784a7f0b64ec65c#?tab=log

Log:

INFO[18:32:13]  * [OK] Step dependency (go) installed, available. 
Configs:
- Version: 26
- Resolution: 240x426
- Density: 120
- Orientation: portrait
- Tag: google_apis
- ABI: armeabi-v7a
- Profile: Nexus 6P
- ID: emulator
- CustomCommandFlags: -no-window -no-audio -debug-init
- Overwrite: true
- CustomConfig:
disk.dataPartition.size=1024M
hw.camera.back=emulated
hw.camera.front=emulated
hw.keyboard=yes
hw.gpu.enabled=true
hw.gpu.mode=swiftshader
hw.ramSize=1536
runtime.network.latency=none
runtime.network.speed=full
showDeviceFrame=no
skin.dynamic=yes
skin.path=_no_skin
skin.path.backup=_no_skin
vm.heapSize=384
Ensure sdk packages: [tools platform-tools system-images;android-26;google_apis;armeabi-v7a]
Failed to update emulator sdk package, error: exit status 1, output: Loading package information...                                                  
Loading local repository...                                                     
[                                       ] 3% Loading local repository...        
[                                       ] 3% Fetch remote repository...         
[                                       ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 3% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
[=                                      ] 4% Fetch remote repository...         
                                                                                
Warning: File /Users/vagrant/.android/repositories.cfg could not be loaded.
[=                                      ] 4% Fetch remote repository...         
[==                                     ] 5% Fetch remote repository...         
[==                                     ] 6% Fetch remote repository...         
[==                                     ] 6% Computing updates...               
[===                                    ] 8% Computing updates...               
[===                                    ] 8% Computing updates...               
[===                                    ] 10% Computing updates...              
                                                                                
Warning: Failed to find package system-images;android-26;google_apis;armeabi-v7a
[===                                    ] 10% Computing updates...
0 Likes

Emulate android
#2

Sorry about the issue @dominik.roszkowski!

As I believe you might have seen in the original emulator thread, we’re not seeing the AVD Manager working reliably on any other environment than the LTS stack at the monent unfortunately :frowning: What is your use case for the Android Emulator on a macOS?

0 Likes

#3

I’d like to perform Flutter UI tests on both iPhone simulator and Android emulator. Unfortunately when using Android stack I need to install Flutter and some other tools required for UI testing.

0 Likes

#4

Such package simply does not exist. The newest image for armeabi-v7a uses API level 25. You are requesting 26.

0 Likes

#5

Thanks!

So I tried to fix it but unfortunately Android emulator does not start.
Please take a look at my build: https://app.bitrise.io/build/af76b17344014654#?tab=log

   +1 ms] executing: /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/emulator/emulator -avd Android -no-audio -no-window -no-snapshot -gpu swiftshader
[   +1 ms] executing: [./] /tmp/screenshots/resources/script/android-wait-for-emulator
[ +228 ms] Waiting for emulator to start: 599 of 600 : status: error: no emulators found
[+1133 ms] Waiting for emulator to start: 598 of 600 : status: error: no emulators found
[+1048 ms] Waiting for emulator to start: 597 of 600 : status: error: no emulators found

I created the emulator via:

avdmanager create avd --name "Android" -k "system-images;android-25;google_apis;armeabi-v7a" -f -d 11
0 Likes

#6

Any ideas when this will get fixed - I’m trying to use it for the same reason of running Flutter UI tests (integration tests via Flutter driver) and getting the same failing AVD Manager issue. Thanks

0 Likes

#7

I got an answer directly that Bitrise team is investigating the issue. I hope this will be easy to fix :crossed_fingers:

1 Like

#8

Hi @koral and @bitce is there any update on running Android emulators on macOS stacks?

0 Likes

#9

I’m not a Bitrise employee :wink: so I don’t have any more information.

0 Likes