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.
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:
Vtx is supported on my machine as well , here is the lscpu command:
And finally the grep --color vmx /proc/cpuinfo command:
As you can see here I have a list of created devices using the avd manager
./avdmanager list
However when I run tns device android --available-devices I see none:
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
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:
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