简体   繁体   中英

Android / Cordova emulator: ERROR: virtual device name contains invalid characters

I have installed Android Studio and Cordova. I have created a new Cordova project called myapp. I have set an emulator via Tools -> Android -> AVD Manager, choosing:

4.65" 720p (Galaxy Nexus)

The device shows up:

$ cordova run --list
Available android devices:
Available android virtual devices:
4.65_720p_(Galaxy_Nexus)_API_23

When I try to build and run the project on this emulator I get the following error message:

$ cordova emulate android
...
BUILD SUCCESSFUL

Total time: 1.284 secs
Built the following apk(s): 
    /home/daniel/cordova/myapp/platforms/android/build/outputs/apk/android-debug.apk
ANDROID_HOME=/home/daniel/Android/Sdk
JAVA_HOME=/usr/lib/jvm/jre1.8.0_101
No emulator specified, defaulting to 4.65_720p_(Galaxy_Nexus)_API_23
Waiting for emulator to start...
emulator: ERROR: virtual device name contains invalid characters
emulator: could not find virtual device named '4.65_720p_(Galaxy_Nexus)_API_23'

Solution

The problem was with the name of the virtual device. I changed the name to "Galaxy Nexus" in the AVD Manager in Android Studio and the problem went away.

从虚拟设备名称中删除parentesis

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM