Could not find an emulator image to run your project


#1

Hi, I just started learning NativeScript and Android. I’m using Linux Fedora 25. I created a new project in the CLI. When I wrote “tns run android” command in projemen, “Could not find an emulator image to run your project.” I’m getting the error.

Thank you.


#2

Hey @mksglu

Depending on how you installed the Android SDK there are several ways to create an emulator image to your application on.

Both of which are explained below
With Android Studio
https://developer.android.com/studio/run/managing-avds.html
Without Android Studio
https://developer.android.com/studio/command-line/avdmanager.html

In case you have a physical android device, you could plug that in, enable Developer mode and run the application there.


#3

Hello @Peter;[quote=“Pete.K, post:2, topic:1032, full:true”]
Hey @mksglu

Depending on how you installed the Android SDK there are several ways to create an emulator image to your application on.

Both of which are explained below
With Android Studio
https://developer.android.com/studio/run/managing-avds.html
Without Android Studio
https://developer.android.com/studio/command-line/avdmanager.html

In case you have a physical android device, you could plug that in, enable Developer mode and run the application there.
[/quote]

First of all, thank you for being interested in my problem. I really want to work on NaticeScript, but I still have problems.

I started using Linux Manjaro XFCE. I reinstalled everything.

The Android Studio Emulator did not work again. This time he did not make a mistake. It just did not work. Nothing appears on the screen.

I installed the Genymotion Emulator. It worked so well.

I set up Native Scrip, it’s okay.

Now my problem is, how can I run my application with Genymotion?

Let me give you a command line and let’s continue according to your error output.

Thank you again.


#4

My normal procedure for using Genymotion is to open the Genymotion emulator and then to run tns run android


#5

This. Using the NS CLI and Genymotion emulators all along I’ve never had to explicitly provide additional flags. tns run android with a running geny emulator works every time for me.


#6

Hi, thanks again for your interest.

Error output:

Tns run android

Skipping prepare.
Searching for devices ...
Error: Command failed: adb devices
Error: could not install * smartsocket * listener: Address already in use
ADB server did not ACK
* Failed to start daemon *
Error: can not connect to daemon

     At ChildProcess.exithandler (child_process.js: 210: 12)
     At emitTwo (events.js: 106: 13)
     At ChildProcess.emit (events.js: 194: 7)
     At maybeClose (internal / child_process.js: 899: 16)
     At Socket. <Anonymous> (internal / child_process.js: 342: 11)
     At emitOne (events.js: 96: 13)
     At Socket.emit (events.js: 191: 7)
     At Pipe._handle.close [as _onclose] (net.js: 513: 12)

Update

Now I solved the problem. I can not believe this. The tns doctor command told me that the Android SDK is not defined. It had to be defined. Again;

ANDROID_HOME = / home / mksglu / Android / Sdk
PATH = $ PATH: $ ANDROID_HOME / tools: ANDROID_HOME / platform-tools
Export ANDROID_HOME
Export PATH

I applied your commands. I ran Geynmotion. I ran the tns run android command and it worked successfully.

What should I do to make my PATH settings permanent?

SOLVED
vim ~/.bashrc