Skip to content

Android emulator error #5069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Saface89 opened this issue Oct 12, 2019 · 3 comments
Closed

Android emulator error #5069

Saface89 opened this issue Oct 12, 2019 · 3 comments

Comments

@Saface89
Copy link

I have a problem running the android emulator. When I execute tns run android I have an error. Help me solve the problem please.

MacOS Mojave 10.14.6

«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 --available-devices’.»
export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/$
export ANDROID_HOME=/usr/local/share/android-sdk
export ANDROID_SDK_ROOT=/usr/local/share/android-sdk
Снимок экрана 2019-10-10 в 09 36 49
Снимок экрана 2019-10-10 в 09 37 29
Снимок экрана 2019-10-10 в 09 46 47

@Saface89
Copy link
Author

tns run android --log trace

Trying to get macOS version.
Exec system_profiler SPSoftwareDataType -detailLevel mini
stdout: Software:

System Software Overview:

System Version: macOS 10.14.6 (18G103)
Kernel Version: Darwin 18.7.0
Time since boot: 15:21
stderr:
macOS version based on system_profiler is 10.14.
Looking for project in '/Users/saface/Desktop/DEV/study/food-app'
Project directory is '/Users/saface/Desktop/DEV/study/food-app'.
Loading extensions.
Asserting extension nativescript-cloud is installed.
Extension nativescript-cloud is installed.
System information:
[Object: null prototype] {
platform: 'darwin',
shell: '/bin/bash',
os:
'Darwin MacBook-Pro-Saface.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64\n',
procArch: 'x64',
nodeVer: '10.16.0',
npmVer: '6.9.0',
nodeGypVer: null,
nativeScriptCliVersion: '6.1.2',
gitVer: '2.19.0',
dotNetVer: null,
javacVersion: '1.8.0_222',
javaVersion: '1.8.0_222',
adbVer: '1.0.41',
androidInstalled: true,
monoVer: null,
gradleVer: null,
isAndroidSdkConfiguredCorrectly: true,
xcodeVer: '11.1.0',
xcodeprojLocation: '/usr/local/bin/xcodeproj',
itunesInstalled: true,
cocoaPodsVer: '1.8.3',
isCocoaPodsWorkingCorrectly: true,
isCocoaPodsUpdateRequired: false,
pythonInfo: { isInstalled: true, isSixPackageInstalled: true } }
Error: Trying to handle SIGINT event. CLI overrides this behavior and does not allow handling SIGINT as this causes issues with Ctrl + C in terminal
at process.on (/usr/local/lib/node_modules/nativescript/lib/nativescript-cli.js:22:22)
at /usr/local/lib/node_modules/nativescript/node_modules/signal-exit/index.js:122:15
at Array.filter ()
at load (/usr/local/lib/node_modules/nativescript/node_modules/signal-exit/index.js:120:21)
at module.exports (/usr/local/lib/node_modules/nativescript/node_modules/signal-exit/index.js:35:5)
at Object. (/usr/local/lib/node_modules/nativescript/node_modules/proper-lockfile/lib/lockfile.js:296:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/usr/local/lib/node_modules/nativescript/node_modules/proper-lockfile/index.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
spawn: /usr/local/bin/node "/usr/local/lib/node_modules/nativescript/lib/detached-processes/cleanup-process.js" "/usr/local/lib/node_modules/nativescript/lib/bootstrap.js"
Exec npm view tns-core-modules versions --json
stdout: [I removed this]
stderr:
Initializing analytics statuses.
Analytics statuses: { TrackFeatureUsage: 'disabled', TrackExceptions: 'disabled' }
Your ANDROID_HOME environment variable is set and points to correct directory.
Your adb from the Android SDK is correctly installed.
The Android SDK is installed.
A compatible Android SDK for compilation is found.
Javac is installed and is configured properly.
The Java Development Kit (JDK) is installed and is configured properly.
Selected targetSdk is: 28
Installed Android Targets are: [ 'android-28' ]
Selected buildToolsVersion is: 28.0.3
Validate options for platform: Android
Searching for devices...
startLookingForDevices; platform is Android
Options for ios-device-discovery { platform: 'Android',
shouldReturnImmediateResult: false,
emulator: false,
fullDiscovery: undefined }
spawn: /usr/local/share/android-sdk/platform-tools/adb "start-server"
Result when throw error is false:
{ stdout: '', stderr: '', exitCode: 0 }
spawn: /usr/local/share/android-sdk/platform-tools/adb "devices"
spawn: /usr/local/share/android-sdk/platform-tools/adb "devices"
spawn: /usr/local/share/android-sdk/tools/bin/avdmanager "list" "avds"
spawn: player 0
Configuration error for Genymotion { stdout: '', stderr: 'spawn player ENOENT', exitCode: 'ENOENT' }
No emulator image available for device identifier 'undefined'.
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 --available-devices'.
Error while initializing devicesService: Exception: 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 --available-devices'.
Error: 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 --available-devices'.
at Errors.failWithOptions (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:147:28)
at Errors.fail (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:120:21)
at DevicesService. (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:448:34)
at Generator.throw ()
at rejected (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:11:65)
at process._tickCallback (internal/process/next_tick.js:68:7)

@rosen-vladimirov
Copy link
Contributor

Hey @Saface89 ,
Please excuse us for the delayed reply. It seems you've hit this issue. Can you try setting ANDROID_AVD_HOME as described in this comment and see if this will resolve the issue on your side?

@DimitarTachev
Copy link
Contributor

Hi @Saface89,

We were able to reproduce the issue and open a PR with a fix. Most probably it will be officially released in NativeScript 6.3.1 in a few weeks.

As a workaround, you could pass the identifier of the emulator image to your tns commands. For example: tns run android --device Pixel_API_29.

@DimitarTachev DimitarTachev added this to the 6.3.1 milestone Dec 11, 2019
@DimitarTachev DimitarTachev self-assigned this Dec 11, 2019
@DimitarTachev DimitarTachev modified the milestones: 6.3.1, 6.3.0 Dec 17, 2019
@dtopuzov dtopuzov closed this as completed Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants