经过多次尝试,并尝试了许多我可以在stackoverflow或互联网上其他地方找到的解决方案,我仍然无法在我的计算机上运行模拟器。这台计算机在Windows和Linux引导下都会发生这种情况。我能够启动模拟器,但它仍然是一个完整的黑屏。以下是关于软件的一些信息:我正在使用的Linux Ubuntu 20.04LTS和Android-studio版本:4.1.2。关于我的硬件:
$sudo lshw -short
H/W path Device Class Description
======================================================
system GA-A75M-S2V
/0 bus GA-A75M-S2V
/0/0 memory 128KiB BIOS
/0/4 processor AMD A8-3870 APU with Radeon(tm) HD Graphics
/0/4/a memory 128KiB L1 cache
/0/4/c memory 1MiB L3 cache
/0/b memory 128KiB L1 cache
/0/26 memory 8GiB System Memory
/0/26/0 memory 4GiB DIMM 1333 MHz (0.8 ns)
/0/26/1 memory 4GiB DIMM 1333 MHz (0.8 ns)
/0/26/2 memory DIMM 1333 MHz (0.8 ns) [empty]
/0/26/3 memory DIMM 1333 MHz (0.8 ns) [empty]
/0/100 bridge Family 12h Processor Root Complex
/0/100/2 bridge Family 12h Processor Root Port
/0/100/2/0 display GK104 [GeForce GTX 670]
/0/100/2/0.1 multimedia GK104 HDMI Audio Controller
/0/100/4 bridge Family 12h Processor Root Port
/0/100/4/0 enp2s0 network RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
首先我检查了虚拟化工作,它似乎很好。
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 40 bits physical, 48 bits virtual
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: AuthenticAMD
CPU family: 18
Model: 1
Model name: AMD A8-3870 APU with Radeon(tm) HD Graphics
Stepping: 0
CPU MHz: 1395.339
CPU max MHz: 3000.0000
CPU min MHz: 800.0000
BogoMIPS: 5999.33
Virtualization: AMD-V
L1d cache: 256 KiB
L1i cache: 256 KiB
L2 cache: 4 MiB
NUMA node0 CPU(s): 0-3
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Full AMD retpoline, STIBP disabled, RSB filling
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_
good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_ps
tate vmmcall arat npt lbrv svm_lock nrip_save pausefilter
然后我尝试了第二次验证!
$ virt-host-validate
QEMU: Checking for hardware virtualization : PASS
对于flutter doctor
,它写的是设备离线,我有一个全黑屏。在这里,我尝试了很多方法,用硬件或软件渲染图形,改变RAM,改变核数,改变x86或x86_64的CPU arch,……$flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[!] Android Studio
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.52.1)
[!] Connected device
! Device emulator-5554 is offline.
! Doctor found issues in 2 categories.
当执行adb devices命令时:
$adb devices
List of devices attached
adb server version (41) doesn't match this client (39); killing...
* daemon started successfully
我总是在最后得到这个错误:等待模拟器上线300秒后超时。
我试图做adb server-killer
等,做冷启动等,…毫无效果。我还是有同样的问题。以前我用的是另一台电脑,一切都很好。我完全在这里挣扎。
$adb kill-server
$adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
当运行logcat时,我得到了一个重启循环。
$./emulator -avd Pixel_2_API_30 -debug-init -logcat '*:v'
emulator: Android emulator version 30.3.5.0 (build_id 7033400) (CL:N/A)
emulator: Found AVD name 'Pixel_2_API_30'
emulator: Found AVD target architecture: x86
...
[ 1.453200] Run /init as init process
[ 1.454227] traps: init[1] trap invalid opcode ip:59434e sp:ffa11a60 error:0 in init[462000+139000]
[ 1.455590] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[ 1.456724] CPU: 0 PID: 1 Comm: init Not tainted 5.4.61-android11-0-00791-gbad091cc4bf3-ab6833933 #1
[ 1.458050] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.1-0-g0551a4be2c-prebuilt.qemu-project.org 04/01/2014
[ 1.459787] Call Trace:
[ 1.460170] dump_stack+0x95/0xe5
[ 1.460702] panic+0x112/0x39a
[ 1.461069] do_exit+0xa99/0xb00
[ 1.461455] do_group_exit+0x89/0xa0
[ 1.461887] get_signal+0x999/0xae0
[ 1.462306] ? _raw_spin_unlock_irqrestore+0x1a/0x40
[ 1.462890] ? force_sig_info_to_task+0x111/0x120
[ 1.463641] do_signal+0x80/0x250
[ 1.464039] prepare_exit_to_usermode+0x8d/0x100
[ 1.464589] ? invalid_op+0xa/0x30
[ 1.464993] retint_user+0x8/0x8
[ 1.465378] RIP: 0023:0x59434e
[ 1.465743] Code: f7 83 e1 03 c1 e6 0c c1 e1 0a 09 d6 0f b6 d3 8b 5c 24 0c 09 d1 8b 55 08 09 f1 81 c9 00 01 00 00 66 0f 6e c1 8b 92 40 95 00 00 <f2> 0f 38 f1 d3 f2 0f 38 f1 d1 f2 0f 38 f1 d0 0f b7 c0 89 d6 c1 ee
[ 1.468434] RSP: 002b:00000000ffa11a60 EFLAGS: 00010202
[ 1.469069] RAX: 0000000000000000 RBX: 00000000f7f80a60 RCX: 0000000000018102
[ 1.469901] RDX: 0000000051746398 RSI: 0000000000018000 RDI: 0000000000000018
[ 1.470732] RBP: 00000000ffa11a98 R08: 0000000000000000 R09: 0000000000000000
[ 1.471564] R10: 0000000000000000 R11: 0000000000000216 R12: 0000000000000000
[ 1.472394] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[ 1.473344] Kernel Offset: 0x29000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 1.475542] Rebooting in 5 seconds..
emulator: No acpi ini file provided, using default
...
你知道我到底错过了什么吗?我不能发布图片。我希望你能帮助我。多谢,
我终于找到了解决办法。因为我使用的是旧的AMV处理器,所以我需要为模拟器使用基于ARM的映像,而不是x86映像。然后我就可以运行它了。不幸的是,我的处理器不够强大,并且在启动android模拟器时非常滞后。我不得不买一台新电脑。