tns run/devices fails (w/ fix info)
@rosen-vladimirov ya está trabajando en esto.
Desde el 15/4/2019.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Environment
- CLI: 5.3.1
Describe the bug
After upgrading to the latest version of the Android Studio Emulator, Images, SDK;
tns devices fails with the following error:
Connected devices & emulators
Searching for devices...
Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.
tns run android fails with:
Searching for devices...
Cannot find connected devices.
Emulator start failed with: No emulator image available for device identifier 'undefined'.
To list currently connected devices and verify that the specified identifier exists, run 'tns device'.
To list available emulator images, run 'tns device <Platform> --available-devices'.
Doing a tns devices --log full gives me this:
spawn: /home/.../Android/Sdk/platform-tools/adb "devices"
Error while checking for devices. TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at assertPath (path.js:39:11)
at Object.join (path.js:1155:7)
at AndroidVirtualDeviceService.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/common/mobile/android/android-virtual-device-service.js:65:38)
at Generator.next (<anonymous>)
at fulfilled (/usr/local/lib/node_modules/nativescript/lib/common/mobile/android/android-virtual-device-service.js:10:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.
(node:14038) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated
Key line being: android-virtual-device-service.js:65
tns doctor shows no issues.
adb devices -- does show the running emulators properly...
To Reproduce
Upgrade to the latest sdk, tools:

Expected behavior
It actually works. 😀
Additional context
Setting the
ANDROID_AVD_HOME & ANDROID_SDK_ROOT fixes the issue. From what I can gather ANDROID_HOME is now depreciated... So this might need to be an added error in TNS doctor; and a warning here instead of throwing an error that is unhelpful...
ANDROID_SDK_ROOT should be the same value as ANDROID_HOME
ANDROID_AVD_HOME on my Linux machine ends up being /home/<USER_NAME>/.android/avd/
On mac, it will probably be /Users/<USER_NAME>/.android/avd/
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.1k
- Forks
- 204
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 8
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NativeScript/nativescript-cli
-
in-progress
NativeScript/nativescript-cli#6140 · 2 comentarios · 1 asignado ·
-
NativeScript/nativescript-cli#6090 · 1 asignado ·
-
in progress
NativeScript/nativescript-cli#6015 · 1 reacción · 1 asignado ·
-
question
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
NativeScript/nativescript-cli#5992 · 5 comentarios ·
-
feature-pending-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
NativeScript/nativescript-cli#5975 ·
Todos los issues de NativeScript/nativescript-cli
Issues similares
-
Edit: CW+ Abiertochannels:edit check:passed
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
스택 PR 머지 시 하위 PR base 재지정 단계 부재 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
idean3885/claude-ops-agent#521 ·
-
[Nytt ikon]: menu-search Abiertoforespørsel 🥰 ikoner 🖼 nytt ✨
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100