Nativescript: Component tns-core-modules & tns-android & tns-ios is not installed

Created on 16 Apr 2018  ยท  9Comments  ยท  Source: NativeScript/NativeScript

Node v9.11.1
macOS High Sierra
tns-version - 4.0.0
Package.json:
"version": "4.0.0"
And there are no tns-android nor tns-ios. Instead:

  "nativescript": {
    "platforms": {
      "ios": "3.0.0",
      "android": "3.0.0"
    }
  },

I have tried to install iOS and Android - ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)" and got bunch of errors that Android and Xcode are not installed correctly. Setting up Xcode's Preferences > Locations > Command Line Tools helped to finish installation on next try. Then tns-doctor shows that "No issues were detected", but you can see bellow that tns-core-modules, tns-android and tns-ios is not installed.

โœ” 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.
โœ” Xcode is installed and is configured properly.
โœ” xcodeproj is installed and is configured properly.
โœ” CocoaPods are installed.
โœ” CocoaPods update is not required.
โœ” CocoaPods are configured properly.
โœ” Your current CocoaPods version is newer than 1.0.0.
โœ” Python installed and configured correctly.
โœ” The Python 'six' package is found.
No issues were detected.
โœ” Getting NativeScript components versions information...
โœ” Component nativescript has 4.0.0 version and is up to date.
โœ– Component tns-core-modules is not installed.
โœ– Component tns-android is not installed.
โœ– Component tns-ios is not installed.

Running tns info showed:
โš  Update available for component tns-core-modules. Your current version is 3.4.1 and the latest available version is 4.0.0. so tns-update fixed the "Component tns-core-modules is not installed." error and tns-info:

โœ” Getting NativeScript components versions information...
โœ” Component nativescript has 4.0.0 version and is up to date.
โœ” Component tns-core-modules has 4.0.0 version and is up to date.
โœ– Component tns-android is not installed.
โœ– Component tns-ios is not installed.

Now after app created if I run tns run android I get:

Cannot find connected devices.
Emulator start failed with: Cannot resolve the specified connected device by the provided index or identifier. To list currently connected devices and verify that the specified index or identifier exists, run 'tns device'.
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'.

But tns run ios starts the emulator. and tns info:

โœ” Getting NativeScript components versions information...
โœ” Component nativescript has 4.0.0 version and is up to date.
โœ” Component tns-core-modules has 4.0.0 version and is up to date.
โœ– Component tns-android is not installed.
โœ” Component tns-ios has 4.0.1 version and is up to date.

Most helpful comment

Looks like now I get also Android emulator after I created it manually:

$ cd $ANDROID_HOME/tools/bin

$ ./sdkmanager "system-images;android-25;google_apis;x86"

$ ./sdkmanager --licenses

If I ran next command I got warning:

.android/repositories.cfg could not be loaded

So creds to this link :

$ touch ~/.android/repositories.cfg

And lastly:

$ avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"

Now I run tns run android and emulator appears.

Not sure why it didn't worked - seems I need to download the emulator package even though sdkmanager --list gives a list of installed packages and one of them was:

system-images;android-25;google_apis;x86 | 12 | Google APIs Intel x86 Atom System Image

EDIT - looks like all is fine now - tns-android and tns-ios are installed

All 9 comments

Looks like now I get also Android emulator after I created it manually:

$ cd $ANDROID_HOME/tools/bin

$ ./sdkmanager "system-images;android-25;google_apis;x86"

$ ./sdkmanager --licenses

If I ran next command I got warning:

.android/repositories.cfg could not be loaded

So creds to this link :

$ touch ~/.android/repositories.cfg

And lastly:

$ avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"

Now I run tns run android and emulator appears.

Not sure why it didn't worked - seems I need to download the emulator package even though sdkmanager --list gives a list of installed packages and one of them was:

system-images;android-25;google_apis;x86 | 12 | Google APIs Intel x86 Atom System Image

EDIT - looks like all is fine now - tns-android and tns-ios are installed

Hi @Juliusdz,
While following the provided info I am assuming that you were able to fix the issues, and now you can create and build NativeScript project.

Regarding Component tns-android is not installed. issue.
Make sure that the platform/android folder exists in your project. If it is missing run tns platform add android command and again tns info. Then the Warning should disappear.

@tsonevn - yep, seems its all good, so I close this. Thanks!

Hi @Juliusdz
where is the $ANDROID_HOME folder located ? couldn't find it !

HI @abdul-elah-js,
$ANDROID_HOME is a global variable, which contains the path to Android SDK folder. You can check this section from docs, where it is described, how to setup this variable as well.

Hi @Juliusdz .
That seems not work for me. can you help me please.

Hi @Castor243,
Please provide more info about the issue, you are facing.

I am having the same issue here despite tns doctor indicating that everything is fine:
tns-doctor
Vtx is supported on my machine as well , here is the lscpu command:
lscpu
And finally the grep --color vmx /proc/cpuinfo command:
vmx

As you can see here I have a list of created devices using the avd manager
./avdmanager list
avdmanager
However when I run tns device android --available-devices I see none:
nadroid-device

Can someone help figure out whats wrong with my set up, I feel like every thing checks out yet I can't start an emulator at all. Thanks

When i create a new avd, I have the below error: (Help me please)
Error: Package path is not valid. Valid system image paths are:ository...
system-images;android-25;google_apis;x86_64
null

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NathanaelA picture NathanaelA  ยท  92Comments

rclai picture rclai  ยท  52Comments

dbbk picture dbbk  ยท  54Comments

valentinstoychev picture valentinstoychev  ยท  136Comments

tjvantoll picture tjvantoll  ยท  58Comments