适用于 Android 12 的模拟器预览无连接

问题描述

我已经安装了 Android 12 Preview 模拟器。我遇到了很多问题,因为模拟器在启动时崩溃了,但是在卸载并再次安装并重新启动机器等之后,我设法启动了它。 我现在遇到的问题是互联网连接不起作用。 所有其他模拟器都可以正常工作。 我试图从命令行启动模拟器来设置 dns

~/Library/Android/sdk/emulator/emulator -avd Pixel_5_API_S -dns-server 8.8.8.8 

我得到的是网络仍然不工作,我可以看到很多日志:

vqParseGuestToHostRequestLocked:734 {src_port=2489684015 dst_port=4294967295} 意外的 dst_port

vqParseGuestToHostRequestLocked:734 {src_port=2489684016 dst_port=4294967295} 意外的 dst_port

vqParseGuestToHostRequestLocked:734 {src_port=2489684017 dst_port=4294967295} 意外的 dst_port

vqParseGuestToHostRequestLocked:734 {src_port=2489684018 dst_port=4294967295} 意外的 dst_port

这是我正在使用的模拟器:

Name: Pixel_5_API_S
cpu/ABI: Google Apis Intel Atom (x86_64)
Path: /Users/username/.android/avd/Pixel_5_API_S.avd
Target: google_apis [Google Apis] (API level S)
Skin: pixel_4
SD Card: 512M
fastboot.chosenSnapshotFile: 
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel_5
hw.lcd.width: 1080
image.androidVersion.codename: S
hw.initialOrientation: Portrait
image.androidVersion.api: 30
tag.id: google_apis
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Pixel 5 API S
hw.gpu.mode: auto
hw.ramSize: 1536
PlayStore.enabled: false
fastboot.forceColdBoot: no
hw.cpu.ncore: 4
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 2340
vm.heapSize: 256
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images/android-S/google_apis/x86_64/
showDeviceFrame: yes
hw.camera.back: virtualscene
AvdId: Pixel_5_API_S
hw.lcd.density: 440
hw.arc: false
hw.device.hash2: MD5:3274126e0242a0d86339850416b0ce34
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackball: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google Apis
runtime.network.latency: none
disk.dataPartition.size: 6442450944
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes

enter image description here

解决方法

基于 issuetracker,Android S beta 2 模拟器映像依赖于模拟器本身的较新版本(没有明确要求)。应通过从 canary channel 安装较新的 30.7.3 版模拟器来解决此问题。


更新 2021-06-23:模拟器 30.7.4 现已在稳定版中推出。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...