I have issues starting android emulator Nexus 5 from Android Device Manager in Visual Studio, i tried to enable Hyper-V, AEHD and HAXM, but it didn't work. For some reason i don't see emulator in "adb devices" and also when i start it i can't stop it from Android Device Manager.
I tried to follow Microsoft troubleshoot but it didn't help, i can't start emulator via CMD "emulator -avd avd_name [ {-option [value]} … ]", i also tried to reinstall SDK but that didn't help. When i start debugging with that emulator it just start deploying and progress bar appears but it freezes there, i waited 1 hour but nothing happened. Do you maybe know how should i fix that?
Here is start of log file:
[23-07-13 16.15.38.75] Android Device Manager version 17.6.0.76-HEAD@aca9c0a
[23-07-13 16.15.38.75] Build date: 12.7.2023. 14.24.53
[23-07-13 16.15.38.75] Operating system: Windows 10 v10.0.19045 (Windows 10 Pro; Microsoft Windows 10 v10.0.19045 (Windows 10 Pro; 64-bit)), 64-bit
[23-07-13 16.15.38.75] Run arguments: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Xamarin\AndroidDeviceManager\AndroidDevices.exe" android-registry=SOFTWARE\Xamarin\VisualStudio\17.0_4a684485\Android mono-android-path="C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\Android" log-path="<USER_HOME>\AppData\Local\Xamarin\Logs\17.0" vs-pid=12052 vs_version=17.6 p=7cbf9e92-6396-4a99-9c0c-dc5b99175070 telemetry_session="{\"IsOptedIn\":true,\"HostName\":\"Dev14\",\"AppInsightsInstrumentationKey\":\"f144292e-e3b2-4011-ac90-20e5c03fbce5\",\"AsimovInstrumentationKey\":\"AIF-312cbd79-9dbb-4c48-a7da-3cc2a931cb70\",\"CollectorApiKey\":\"f3e86b4023cc43f0be495508d51f588a-f70d0e59-0fb0-4473-9f19-b4024cc340be-7296\",\"AppId\":1001,\"UserId\":\"1526062c-98b6-45f0-a17a-9b12d89a4411\",\"Id\":\"6dedc337-fbee-4b74-af8a-f463976f4f11\",\"ProcessStartTime\":638248613028280328,\"SkuName\":\"VS_Community\",\"VSExeVersion\":\"17.6.33829.357\",\"BucketFiltersToEnableWatsonForFaults\":[{\"AdditionalProperties\":[],\"Id\":\"53126781-21df-4995-bac8-6c850c7c1efb\",\"WatsonEventType\":\"VisualStudioMemWatson\",\"BucketParameterFilters\":[\"(?i)perfwatsonstarvation\",null,null,null,null,null,null,null,null,null]}],\"BucketFiltersToAddDumpsToFaults\":[{\"AdditionalProperties\":[{\"Key\":\"DumpType\",\"Value\":\"Heap\"}],\"Id\":\"e9940337-2ead-49ca-8069-098d308bf8c0\",\"WatsonEventType\":\"VisualStudioNonFatalErrors2\",\"BucketParameterFilters\":[null,null,\"vs.fault.faulttest\",null,null,null,null,null,null,null]}]}"
[23-07-13 16.15.38.80] [AppInfo] Detected Android SDK path: C:\Program Files (x86)\Android\android-sdk
[23-07-13 16.15.38.83] --- Device Manager started
[23-07-13 16.15.38.93] Window_LocationChanged
[23-07-13 16.15.39.03] No Android SDK instance matching the 'C:\Program Files (x86)\Android\android-sdk' path
[23-07-13 16.15.39.56] Xamarin manifest base URL: https://aka.ms/xamarin/sdkmanifest/
[23-07-13 16.15.39.57] Parsing: platform tools
[23-07-13 16.15.39.58] Parsing: tools
[23-07-13 16.15.39.58] No elements of this kind found
[23-07-13 16.15.39.58] Parsing: cmdline-tools
[23-07-13 16.15.39.58] Parsing: build tools
[23-07-13 16.15.39.58] Parsing: emulators
[23-07-13 16.15.39.58] Parsing: NDK
[23-07-13 16.15.39.58] Parsing: LLDB
[23-07-13 16.15.39.58] No elements of this kind found
[23-07-13 16.15.39.58] Parsing: patchers
[23-07-13 16.15.39.58] Parsing: platforms
[23-07-13 16.15.39.58] Parsing: system images
[23-07-13 16.15.39.60] Parsing: addons
[23-07-13 16.15.39.60] Parsing: extras
[23-07-13 16.15.39.60] Detecting Android SDK in 'C:\Program Files (x86)\Android\android-sdk'
[23-07-13 16.15.39.61] Detecting component Android SDK Platform-Tools r34.0.3 in directory 'C:\Program Files (x86)\Android\android-sdk\platform-tools'
[23-07-13 16.15.39.61] Found revision 34.0.3 on the system
[23-07-13 16.15.39.61] Detecting component Android SDK Platform-Tools r34.0.1 in directory 'C:\Program Files (x86)\Android\android-sdk\platform-tools'
[23-07-13 16.15.39.61] Found revision 34.0.3 on the system
[23-07-13 16.15.39.61] Detecting component Android SDK Platform-Tools r33.0.3 in directory 'C:\Program Files (x86)\Android\android-sdk\platform-tools'
[23-07-13 16.15.39.62] Found revision 34.0.3 on the system
[23-07-13 16.15.39.62] Detecting component Android SDK Platform-Tools r33.0.2 in directory 'C:\Program Files (x86)\Android\android-sdk\platform-tools'
[23-07-13 16.15.39.62] Found revision 34.0.3 on the system
[23-07-13 16.15.39.62] Detecting component Android SDK Command-line Tools r7.0 in directory 'C:\Program Files (x86)\Android\android-sdk\cmdline-tools/7.0'
[23-07-13 16.15.39.62] Found revision 7.0 on the system
[23-07-13 16.15.39.62] Component Android SDK Command-line Tools r6.0 not present on the system
[23-07-13 16.15.39.62] Component Android SDK Command-line Tools r5.0 not present on the system
[23-07-13 16.15.39.62] Component Android SDK Build-Tools 33.0.2 r33.0.2 not present on the system
[23-07-13 16.15.39.62] Component Android SDK Build-Tools 33.0.1 r33.0.1 not present on the system
[23-07-13 16.15.39.62] Component Android SDK Build-Tools 33 r33.0.0 not present on the system
[23-07-13 16.15.39.62] Detecting component Android SDK Build-Tools 32 r32.0.0 in directory 'C:\Program Files (x86)\Android\android-sdk\build-tools/32.0.0'
[23-07-13 16.15.39.62] Found revision 32.0.0 on the system
[23-07-13 16.15.39.62] Component Android SDK Build-Tools 31 r31.0.0 not present on the system
[23-07-13 16.15.39.62] Component Android SDK Build-Tools 30.0.3 r30.0.3 not present on the system
[23-07-13 16.15.39.62] Component Android SDK Build-Tools 30.0.2 r30.0.2 not present on the system
[23-07-13 16.15.39.62] Detecting component Android Emulator r32.1.14 in directory 'C:\Program Files (x86)\Android\android-sdk\emulator'
[23-07-13 16.15.39.62] Found revision 32.1.14 on the system
[23-07-13 16.15.39.62] Detecting component Android Emulator r32.1.14 in directory 'C:\Program Files (x86)\Android\android-sdk\emulator'
[23-07-13 16.15.39.62] Found revision 32.1.14 on the system
[23-07-13 16.15.39.62] Detecting component Android Emulator r32.1.14 in directory 'C:\Program Files (x86)\Android\android-sdk\emulator'
[23-07-13 16.15.39.62] Found revision 32.1.14 on the system
[23-07-13 16.15.39.62] Detecting component NDK r22.1.7171670 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.62] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.62] Detecting component NDK r22.0.7026061 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.62] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.62] Detecting component NDK r21.4.7075529 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.62] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.62] Detecting component NDK r21.3.6528147 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.62] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.62] Detecting component NDK r21.2.6472646 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.62] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.62] Detecting component NDK r21.1.6352462 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.62] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.62] Detecting component NDK r21.0.6113669 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.62] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.62] Detecting component NDK r20.1.5948944 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.62] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.62] Detecting component NDK r20.0.5594570 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.62] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.63] Detecting component NDK r19.2.5345600 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.63] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.63] Detecting component NDK r19.0.5232133 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.63] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.63] Detecting component NDK r18.1.5063045 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.63] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.63] Detecting component NDK r17.2.4988734 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.63] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.63] Detecting component NDK r16.1.4479499 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.63] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.63] Detecting component NDK r14.1.3816874 in directory 'C:\Program Files (x86)\Android\android-sdk\ndk-bundle'
[23-07-13 16.15.39.63] Found revision 20.1.5948944 on the system
[23-07-13 16.15.39.63] Component NDK (Side by side) 22.1.7171670 r22.1.7171670 not present on the system
[23-07-13 16.15.39.63] Component NDK (Side by side) 22.0.7026061 r22.0.7026061 not present on the system
[23-07-13 16.15.39.63] Component NDK (Side by side) 21.4.7075529 r21.4.7075529 not present on the system
[23-07-13 16.15.39.63] Component NDK (Side by side) 21.3.6528147 r21.3.6528147 not present on the system
[23-07-13 16.15.39.63] Component NDK (Side by side) 21.2.6472646 r21.2.6472646 not present on the system
[23-07-13 16.15.39.63] Component NDK (Side by side) 21.1.6352462 r21.1.6352462 not present on the system
[23-07-13 16.15.39.63] Component NDK (Side by side) 21.0.6113669 r21.0.6113669 not present on the system
[23-07-13 16.15.39.63] Component NDK (Side by side) 20.1.5948944 r20.1.5948944 not present on the system
[23-07-13 16.15.39.63] Component NDK (Side by side) 20.0.5594570 r20.0.5594570 not present on the system
Here is end of log file:
[23-07-13 16.23.13.92] Going to stop nexus_5_-_api_23
[23-07-13 16.23.13.92] [AvdInfo.Stop] Enter
[23-07-13 16.23.13.93] [EmulatorManager.Stop] Enter. EmulatorName:
[23-07-13 16.23.13.93] AVDStatusToButtonTextConverter [Convert]Stop
[23-07-13 16.23.13.93] AVDStatusToButtonTextConverter [Convert]Stop
[23-07-13 16.23.13.93] AVDStatusToButtonTextConverter [Convert]Stop
[23-07-13 16.23.13.93] [EmulatorManager.Stop] AVDNamenexus_5_-_api_23
[23-07-13 16.23.13.93] [GetEmulatorNameRunningAvd]:+ avdNamenexus_5_-_api_23
[23-07-13 16.23.13.93] [ProcessStartInfoAsInvoker] Executing command: "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" "devices"
[23-07-13 16.23.13.98] [EmulatorManager.Stop] EmulatorName is:
[23-07-13 16.23.13.98] [ProcessStartInfoAsInvoker] Executing command: "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" "devices"
[23-07-13 16.23.14.02] [GetEmulatorNameRunningAvd]:+ avdNamenexus_5_-_api_23
[23-07-13 16.23.14.02] [ProcessStartInfoAsInvoker] Executing command: "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" "devices"
[23-07-13 16.23.14.49] [ProcessStartInfoAsInvoker] Executing command: "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" "devices"
[23-07-13 16.23.14.58] [GetEmulatorNameRunningAvd]:+ avdNamenexus_5_-_api_24
[23-07-13 16.23.14.58] [ProcessStartInfoAsInvoker] Executing command: "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" "devices"
When i start it via CMD i get this:
Microsoft Windows [Version 10.0.19045.3208]
(c) Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>emulator -avd nexus_5_-_api_23
INFO | Android emulator version 32.1.14.0 (build_id 10330179) (CL:N/A)
INFO | Found systemPath C:\Program Files (x86)\Android\android-sdk\system-images\android-23\google_apis\x86\
INFO | Storing crashdata in: C:\Users\Miroslav\AppData\Local\Temp\\AndroidEmulator\emu-crash.db, detection is enabled
INFO | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
INFO | IPv4 server found: 109.122.99.130
C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-i386.exe: -usbdevice tablet: '-usbdevice' is deprecated, please use '-device usb-...' instead
HAX is working and emulator runs in fast virt mode.
C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-i386.exe: -drive format=raw,file=cat:C:\Users\Miroslav\.android\avd\nexus_5_-_api_23.avd\system.img.qcow2|C:\Users\Miroslav\.android\avd\nexus_5_-_api_23.avd\userdata-qemu.img.qcow2|C:\Users\Miroslav\.android\avd\nexus_5_-_api_23.avd\vendor.img.qcow2: cat driver can't open backing file C:\Users\Miroslav\.android\avd\nexus_5_-_api_23.avd\vendor.img.qcow2
I can't find vendor.img.qcow2 at that path
I found a way to start emulator by right clicking on .Droid project file and at Properties section i saw Compile using Android verions set to Anroid 8.1 (Oreo) and i downloaded that emulator with x86 based arhitecture for Nexus 5 phone and still i have issues to show anything on that simulator, i just have blank screen. I also got vendor.img.qcow2 file for that emulator, so i could copy it on other versions and they work then but also show black sreen.
Now when i type "adb devices" command i get:
List of devices attached
emulator-5554 offline
And i have this in CMD:
D:\Xamarin\xamarin-forms-book-samples\Chapter02\Hello\Hello\Hello>emulator -avd nexus_5_-_api_27
INFO | Android emulator version 32.1.14.0 (build_id 10330179) (CL:N/A)
INFO | Found systemPath C:\Program Files (x86)\Android\android-sdk\system-images\android-27\google_apis_playstore\x86\
INFO | Storing crashdata in: C:\Users\Miroslav\AppData\Local\Temp\\AndroidEmulator\emu-crash.db, detection is enabled
INFO | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
INFO | IPv4 server found: 109.122.99.130
C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-i386.exe: -usbdevice tablet: '-usbdevice' is deprecated, please use '-device usb-...' instead
HAX is working and emulator runs in fast virt mode.
dsound: Could not initialize DirectSoundCapture
dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID
WARNING | *** No gRPC protection active, consider launching with the -grpc-use-jwt flag.***
INFO | Started GRPC server at 127.0.0.1:8554, security: Local, auth: none
INFO | Advertising in: C:\Users\Miroslav\AppData\Local\Temp\avd\running\pid_17036.ini
Attempt to initialize voice without DirectSoundCapture object
Attempt to initialize voice without DirectSoundCapture object
Failed to create voice `adc'
I managed to fix "Failed to create voice `adc'" error by going to edit of Android device in Android Device Manager and turning off hw.audioInput and hw.audioOutput properties, or we could change in config.ini file these properties to "no".
But there is another issue:
WARNING | *** No gRPC protection active, consider launching with the -grpc-use-jwt flag.***
INFO | Started GRPC server at 127.0.0.1:8554, security: Local, auth: none
WARNING | Failed to process .ini file C:\Users\Miroslav\AppData\Local\Temp\avd\running\5684 for reading.
INFO | Advertising in: C:\Users\Miroslav\AppData\Local\Temp\avd\running\pid_11216.ini
WARNING | Failed to process .ini file C:\Users\Miroslav\AppData\Local\Temp\avd\running\5684 for reading.
WARNING | Failed to process .ini file C:\Users\Miroslav\AppData\Local\Temp\avd\running\5684 for reading.
I installed newer version of android 13 and it is working properly.