从Visual Studio构建[ProjectName].Android Xamarin.Forms应用程序时,模拟器卡在手机启动屏幕上。

问题描述 投票:0回答:1

我正试图从Visual Studio的模拟器上构建和测试我的Xamarin.Forms Android应用程序,但模拟器却卡在了屏幕上。

Emulator is getting stuck

屏幕上出现了下面的信息,点击后,屏幕上出现了下面的信息。等一下,它又开始显示 电话开始了

enter image description here

下面提到的是构建输出。

2>Starting deployment to pixel_2_pie_9_0_api_28 ...
2>Starting emulator pixel_2_pie_9_0_api_28 ...
2>Checking HAXM compatibility.
2>Installing HAXM...
2>HAXM installer not found: C:\Program Files (x86)\Android\android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager\silent_install.bat
2>Running non-accelerated
2>C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -no-boot-anim -no-accel -avd pixel_2_pie_9_0_api_28 -prop monodroid.avdname=pixel_2_pie_9_0_api_28
2>Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.
2>emulator: WARNING: x86 emulation may not work without hardware acceleration!
2>emulator: WARNING: Not all modern X86 virtualization features supported, which introduces problems with slowdown when running Android on multicore vCPUs. Setting AVD to run with 1 vCPU core only.
2>Failed to open /usr/local/google/home/joshuaduong/emu/master/prebuilts/android-emulator-build/qemu-android-deps/windows_msvc-x86_64/qemu.conf, err: 2
2>dsound: Could not initialize DirectSoundCapture
2>dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID
2>dsound: Attempt to initialize voice without DirectSoundCapture object
2>dsound: Attempt to initialize voice without DirectSoundCapture object
2>audio: Failed to create voice `goldfish_audio_in'
2>C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: warning: opening audio input failed
2>dsound: Attempt to initialize voice without DirectSoundCapture object
2>dsound: Attempt to initialize voice without DirectSoundCapture object
2>audio: Failed to create voice `adc'
2>emulator: INFO: QtLogger.cpp:68: Critical: Uncaught TypeError: Cannot read property 'update' of undefined (qrc:/html/js/location-mock-web-channel.js:130, (null))
2>emulator: INFO: boot completed
2>emulator: INFO: boot time 829388 ms
2>emulator: Increasing screen off timeout, logcat buffer size to 2M.
2>emulator: Revoking microphone permissions for Google App.

更新

我从设备管理器中单独启动模拟器并构建Android解决方案后,发现了下图中给出的信息。

enter image description here

而这是显示的输出。

2>Starting deployment to pixel_2_pie_9_0_api_28 ...
2>Starting emulator pixel_2_pie_9_0_api_28 ...
2>C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -no-boot-anim -avd pixel_2_pie_9_0_api_28 -prop monodroid.avdname=pixel_2_pie_9_0_api_28
2>emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature.
2>Please use -read-only flag to enable this feature.
2>Emulator pixel_2_pie_9_0_api_28 cannot be started.
========== Build: 1 succeeded, 0 failed, 17 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

但是在点击部署错误弹出窗口中的 "是 "或 "否 "后,输出窗口中仍然没有错误。

android xamarin xamarin.forms android-emulator visual-studio-2019
1个回答
0
投票

回答我自己的问题。

首先是HAXM的问题,它没有安装。

然后关于部署错误,在我的情况下,模拟器的名称从Android设备管理器的默认名称被更改。所以我把它改回了默认名称,也就是在添加新设备时给出的名称(例如Nexus 5X)。

这对我来说是可行的,但却花了很长时间来构建和部署!

© www.soinside.com 2019 - 2024. All rights reserved.