Can't run on Android device from macOS


Hey community!

I’m struggling trying to run the HelloWorld template from the Chapter 1—Learning the NativeScript Basics

I’ve posted the error log at the issues tracker on Github.

Any help to get this thing running, or any comment for that matter, is highly appreciated.

Thanks in advance.


What are you getting when you run tns devices
when your device is connected to Mac


$ tns devices

Connected devices & emulators
Searching for devices…
│ # │ Device Name Platform │ Device Identifier │ Type │ Status │
│ 1 │ B1-770_WW_GEN1 │ Android │ 813543652035 │ Device │ Connected │


how about when you try to run on iOS simulator do you face the same issue?
also what do you get when you run tns doctor


The output to tns doctor is in this other post with some others issues I had when installing nativescript. The HelloWord app runs on iOS simulator just fine.


This is a gist with the most recent output.


Here are the things:
It seems you installed your node manually and there are problems with permissions.

My suggestion is following

-uninstall nativescript

npm install -g nativescript

  • install homebrew

/usr/bin/ruby -e "$(curl -fsSL"

brew update

  • then install node8 LTS using brew (last week announced it support node 9 but I would stick with 8 for now)
    brew unlink node
    brew install node@8
    brew link node@8

then install nativescript

npm install -g nativescript

then do tns doctor and share logs


Unfortunately I’m getting the same error, one thing I haven’t tried yet is installing Java 8 and Android SDK via homebrew.


share your new tns doctor

and now what do you get when you do
node -v


homebrew was complaining about Xcode being outdated, just in case I removed the and now I have to wait for it to download from the AppStore. I’ll try agin with node@8 and node@6 and post the results here when Xcode is ready. Currently I have the latest node from homebrew

$ node -v
$ npm -v


@ganas this is the most recent output of tns doctor after I was able to install the latest Xcode stable release. The issue with Android persists though, also tried running on iOS with the new iOS simulator, for iOS the HellowWorld app runs ok. The test was done using node@8

$ node -v


share the output of

ls $ANDROID_HOME/platforms

I wanna make sure you sdk path set correctly.
do you have android studio installed ?


Yes I have Android Studio 3.0.1

23 PM

$ echo $JAVA_HOME




$ echo $PATH

add-ons		cmake		extras		licenses	metrics		patcher		platforms	sources		tools
build-tools	emulator	fonts		lldb		ndk-bundle	platform-tools	skins		system-images

$ ls $ANDROID_HOME/platforms
android-10	android-16	android-17	android-19	android-21	android-22	android-23	android-25	android-26


when you switch to node 8, did you uninstall nativescript and install it again? also do you face the same issue running ios


The app copied to device finally and now it runs fine, at last. I even tried deleting the folder sdk in ~/Library/Android/ (it was occupying too much space anyway) and installing the sdk via homebrew, although it didn’t work either, nor updating the modules in the HelloWorld app with tns update.

What did the trick was removing the android platform and adding android@next like so:

$ tns platform remove android
$ tns platform add android@next

@ganas thank you so much for looking into the problem, I appreciate it a lot.