Ich versuche ein virtuelles Android-Gerät zu starten, das ich mit dem Avdmanager von Android Studio 2.3 erstellt habe (über die Befehlszeile).
alle Befehle werden als root-Benutzer ausgeführt
wenn ich versuche, den Emulator über $ ~/Android/Sdk/tools/./emulator @Nexus_5X_Api_23_x86
zu starten, lautet die Ausgabe:
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: This user doesn't have permissions to use KVM (/dev/kvm)
Ich verwende einen Ubuntu 16.04-Server mit 64-Bit. Android Studio wird über die x11-Weiterleitung gestartet. Daher wird meine Desktop-Umgebung verwendet (dies ist auch ein Ubuntu 16.04, 64-Bit!).
wenn ich $ kvm-ok
tippe, gibt es mir:
INFO: /dev/kvm exists
KVM acceleration can be used
Zum Beweis, dass die .avd, auf die ich zugreifen möchte, vorhanden ist:
$ ~/Android/Sdk/tools/bin/./avdmanager list avd
gibt die Ausgabe aus:März 15, 2017 4:30:53 NACHM. Sun.util.PropertyResourceBundleCharset$PropertiesFileDecoder decodeLoop
INFO: Invalid or unmappable UTF-8 sequence detected. Switching encoding from UTF-8 to ISO-8859-1
Available Android Virtual Devices:
Name: Nexus_5X_Api_23_x86
Device: Nexus 5X (Google)
Path: /root/.Android/avd/Nexus_5X_Api_23_x86.avd
Target: Google APIs (Google Inc.)
Based on: Android 6.0 (Marshmallow) Tag/ABI: google_apis/x86_64
Sdcard: 800M
weiterhin sind die Berechtigungen für /dev/kvm
:
[email protected]:~# ls -l /dev/kvm
crwxrwxrwx 1 root kvm 10, 232 Mär 15 10:48 /dev/kvm
[email protected]:~# groups root
root : root kvm libvirtd libvirt
emulator-check
gibt mir:
[email protected]:~# ~/Android/Sdk/tools/./emulator-check accel hyper-v cpu-info window-mgr desktop-env
accel:
11
This user doesn't have permissions to use KVM (/dev/kvm)
accel
hyper-v:
0
Hyper-V runs only on Windows
hyper-v
cpu-info:
146
Intel CPU|Virtualization is supported|64-bit CPU|
cpu-info
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from ::1 36346
debug1: channel 1: new [x11]
debug1: confirm x11
debug1: channel 1: FORCE input drain
window-mgr:
0
GNOME Shell
window-mgr
desktop-env:
0
mate
desktop-env
Ich weiß wirklich nicht mehr, was ich tun soll, habe im ganzen Forum gesucht, aber keine Nachbildung dieses Problems für mein System gefunden. Die Korrekturen für das gleiche Problem auf anderen Systemen haben für mich nicht funktioniert, ich habe es bereits komplett versucht Lösche und installiere alle Pakete von qemu, libvirt, libvirtd und kvm ohne Erfolg.
Jede Hilfe wird geschätzt !!
edit: ~/Android/Sdk/tools/./emulator @Nexus_5X_Api_23_x86 -verbose
gib mir,
folgende Ausgabe:
emulator:Android emulator version 25.3.0.0 (build_id 3394391)
emulator:Found AVD name 'Nexus_5X_Api_23_x86'
emulator:Found AVD target architecture: x86_64
emulator:argv[0]: '/root/Android/Sdk/tools/./emulator'; program directory: '/root/Android/Sdk/tools'
emulator: Found directory: /root/Android/Sdk/system-images/Android-23/google_apis/x86_64/
emulator:Probing for /root/Android/Sdk/system-images/Android-23/google_apis/x86_64//kernel-ranchu: file exists
emulator:Auto-config: -engine qemu2 (based on configuration)
emulator: Found directory: /root/Android/Sdk/system-images/Android-23/google_apis/x86_64/
emulator:try dir /root/Android/Sdk/tools
emulator:try dir /root/Android/Sdk/tools/./
emulator:try dir /root/Android/Sdk/emulator
emulator:Found target-specific 64-bit emulator binary: /root/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64
emulator:Adding library search path: '/root/Android/Sdk/emulator/lib64'
emulator:Adding library search path: '/root/Android/Sdk/emulator/lib64/libstdc++'
emulator: Found directory: /root/Android/Sdk/system-images/Android-23/google_apis/x86_64/
emulator: Found directory: /root/Android/Sdk/system-images/Android-23/google_apis/x86_64/
emulator:GPU emulation is disabled
emulator: Adding library search path for Qt: '/root/Android/Sdk/emulator/lib64/qt/lib'
emulator: Setting Qt plugin search path: QT_QPA_PLATFORM_PLUGIN_PATH=/root/Android/Sdk/emulator/lib64/qt/plugins
emulator: Running :/root/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64
emulator: qemu backend: argv[00] = "/root/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64"
emulator: qemu backend: argv[01] = "@Nexus_5X_Api_23_x86"
emulator: qemu backend: argv[02] = "-verbose"
emulator: Concatenated backend parameters:
/root/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64 @Nexus_5X_Api_23_x86 -verbose
emulator: Android virtual device file at: /root/.Android/avd/Nexus_5X_Api_23_x86.ini
emulator: virtual device content at /root/.Android/avd/Nexus_5X_Api_23_x86.avd
emulator: virtual device config file: /root/.Android/avd/Nexus_5X_Api_23_x86.avd/config.ini
emulator: using core hw config path: /root/.Android/avd/Nexus_5X_Api_23_x86.avd/hardware-qemu.ini
emulator: Found AVD target API level: 23
emulator: Read property file at /root/Android/Sdk/system-images/Android-23/google_apis/x86_64//build.prop
emulator: No boot.prop property file found.
emulator: Warning: config.ini contains invalid skin.path entry: (null)
emulator: autoconfig: -skin HVGA
emulator: autoconfig: -skindir (null)
emulator: autoconfig: -kernel /root/Android/Sdk/system-images/Android-23/google_apis/x86_64//kernel-ranchu
emulator: Target Arch = 'x86_64'
emulator: Auto-detect: Kernel image requires new device naming scheme.
emulator: Auto-detect: Kernel does not support YAFFS2 partitions.
emulator: autoconfig: -ramdisk /root/Android/Sdk/system-images/Android-23/google_apis/x86_64//ramdisk.img
emulator: Using initial system image: /root/Android/Sdk/system-images/Android-23/google_apis/x86_64//system.img
emulator: autoconfig: -data /root/.Android/avd/Nexus_5X_Api_23_x86.avd/userdata-qemu.img
emulator: autoconfig: -initdata /root/.Android/avd/Nexus_5X_Api_23_x86.avd/userdata.img
emulator: autoconfig: -cache /root/.Android/avd/Nexus_5X_Api_23_x86.avd/cache.img
emulator: autoconfig: -sdcard /root/.Android/avd/Nexus_5X_Api_23_x86.avd/sdcard.img
emulator: Increasing RAM size to 1024MB
emulator: VM heap size 0MB is below hardware specified minimum of 256MB,setting it to that value
emulator: System image is read only
emulator: GPU emulation is disabled
emulator: Found 2 DNS servers: 85.214.7.22 81.169.163.106
emulator: skin name 'HVGA' aliased to '320x480'
emulator: found magic skin width=320 height=480 bpp=16
emulator: CPU Acceleration: DISABLED
emulator: CPU Acceleration status: This user doesn't have permissions to use KVM (/dev/kvm)
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: This user doesn't have permissions to use KVM (/dev/kvm)
Probieren Sie es einfach aus ... das war für mich Arbeit
$ Sudo chown username -R /dev/kvm
manchmal müssen Sie diesen Code auch ausführen
$ cd Android/Sdk/emulator/lib64/libstdc++
$ mv libstdc++.so.6 libstdc++.so.6.bak
$ ln -s /usr/lib64/libstdc++.so.6
Das hat für mich funktioniert (weiß nicht, ob Sie das Problem immer noch haben)
Install Qemu-KVM and cpu-checker
apt-get install qemu-kvm cpu-checker
Check if KVM is available (as jenkins user
$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
Create group kvm and add <your_user> to this group
addgroup kvm
usermod -a -G kvm jenkins
Change group ownership for /dev/kvm
chgrp kvm /dev/kvm
Create udev rule
$ Sudo nano /etc/udev/rules.d/60-qemu-kvm.rules
KERNEL=="kvm", GROUP="kvm", MODE="0660"
Reboot
Quelle: Android-Emulator während des Builds von Jenkins ausführen
Versuchen Sie diese Schritte:
Installieren Sie qemu-kvm wie folgt
Sudo apt install qemu-kvm
Fügen Sie mit dem folgenden Befehl einen Benutzer zur kvm group hinzu:
Sudo adduser <username> kvm
Wenn Sie permission abgelehnt bekommen, versuchen Sie den folgenden Befehl
Sudo chown <username> /dev/kvm
Es funktionierte für mich in Ubuntu 18.04
Ich habe das Problem beim Laufen gelöst
Sudo apt install qemu-kvm
Sudo chown username -R /dev/kvm