Nativescript-angular: Not able to execute tns run in either android and iOS

Created on 23 Jul 2018  Â·  2Comments  Â·  Source: NativeScript/nativescript-angular

I just had this app published, Haven't done any changes after but today when I tried to run in my emulator, it doesn't let me.. I tried with Android and iOS and am getting these messages:

Android (For android emulation, I have been using GenyMotion) :

luanafernandes$ tns run android --log trace

Support for Node.js ^6.0.0 is deprecated and will be removed in one of the next releases of NativeScript. Please, upgrade to the latest Node.js LTS version. 

Loading extensions.
Asserting extension nativescript-cloud is installed.
Extension nativescript-cloud is installed.
Asserting extension nativescript-starter-kits is installed.
Extension nativescript-starter-kits is installed.
Trying to get macOS version.
Exec system_profiler SPSoftwareDataType -detailLevel mini 
 stdout: Software:

    System Software Overview:

      System Version: macOS 10.13.3 (17D102)
      Kernel Version: Darwin 17.4.0
      Time since boot: 16 minutes


 stderr: 
macOS version based on system_profiler is 10.13.
System information:
{ platform: 'darwin',
  shell: '/bin/bash',
  os: 'Darwin Admins-MacBook-Pro.local 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64\n',
  procArch: 'x64',
  nodeVer: '6.11.4',
  npmVer: '3.10.10',
  nodeGypVer: null,
  nativeScriptCliVersion: '4.1.1',
  gitVer: '2.16.2',
  dotNetVer: null,
  javacVersion: '1.8.0_172',
  adbVer: '1.0.40',
  androidInstalled: true,
  monoVer: null,
  gradleVer: null,
  isAndroidSdkConfiguredCorrectly: true,
  xcodeVer: undefined,
  xcodeprojLocation: '/usr/local/bin/xcodeproj',
  itunesInstalled: true,
  cocoaPodsVer: '1.5.3',
  isCocoaPodsWorkingCorrectly: true,
  isCocoaPodsUpdateRequired: false,
  pythonInfo: { isInstalled: true, isSixPackageInstalled: true } }
Looking for project in '/Users/luanafernandes/Documents/GitHub/LCGConnect'
Project directory is '/Users/luanafernandes/Documents/GitHub/LCGConnect'.
Initializing analytics statuses.
Analytics statuses:  { TrackFeatureUsage: 'enabled', TrackExceptions: 'enabled' }
Will send the following information to Google Analytics: { type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'event',
  action: 'Check Local Build Setup',
  label: 'Starting',
  customDimensions: { cd5: 'CLI' } }
spawn: node "/usr/local/lib/node_modules/nativescript/lib/services/analytics/analytics-broker-process.js" "/usr/local/lib/node_modules/nativescript/lib/bootstrap.js"
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.
Will send the following information to Google Analytics: { type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'event',
  action: 'Check Local Build Setup',
  label: 'Finished: Is setup correct: true',
  customDimensions: { cd5: 'CLI' } }
Installed Android Targets are:  [ 'android-25' ]
Directories found in /usr/local/share/android-sdk/build-tools are 27.0.3
Versions found in /usr/local/share/android-sdk/build-tools are 27.0.3
Selected version is:  27.0.3
Selected targetSdk is: 25
Directories found in /usr/local/share/android-sdk/extras/android/m2repository/com/android/support/appcompat-v7 are 18.0.0, 19.0.0, 19.0.1, 19.1.0, 20.0.0, 21.0.0, 21.0.2, 21.0.3, 22.0.0, 22.1.0, 22.1.1, 22.2.0, 22.2.1, 23.0.0, 23.0.1, 23.1.0, 23.1.1, 23.2.0, 23.2.1, 23.3.0, 23.4.0, 24.0.0, 24.0.0-alpha1, 24.0.0-alpha2, 24.0.0-beta1, 24.1.0, 24.1.1, 24.2.0, 24.2.1, 25.0.0, 25.0.1, 25.1.0, 25.1.1, 25.2.0, 25.3.0, 25.3.1, 26.0.0-alpha1, maven-metadata.xml, maven-metadata.xml.md5, maven-metadata.xml.sha1
Versions found in /usr/local/share/android-sdk/extras/android/m2repository/com/android/support/appcompat-v7 are 18.0.0, 19.0.0, 19.0.1, 19.1.0, 20.0.0, 21.0.0, 21.0.2, 21.0.3, 22.0.0, 22.1.0, 22.1.1, 22.2.0, 22.2.1, 23.0.0, 23.0.1, 23.1.0, 23.1.1, 23.2.0, 23.2.1, 23.3.0, 23.4.0, 24.0.0, 24.0.0, 24.0.0, 24.0.0, 24.1.0, 24.1.1, 24.2.0, 24.2.1, 25.0.0, 25.0.1, 25.1.0, 25.1.1, 25.2.0, 25.3.0, 25.3.1, 26.0.0
Selected version is:  25.3.1
Selected AppCompat version is: 25.3.1
Validate options for platform: Android
Will send the following information to Google Analytics: { type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'pageview',
  path: 'run android',
  title: 'run android',
  customDimensions: { cd5: 'CLI' } }
Searching for devices...
startLookingForDevices; platform is Android
spawn: /usr/local/share/android-sdk/platform-tools/adb "start-server"
Result when throw error is false:
{ stdout: '',
  stderr: 'adb server version (39) doesn\'t match this client (40); killing...\n* daemon started successfully\n',
  exitCode: 0 }
spawn: /usr/local/share/android-sdk/platform-tools/adb "devices"
Devices.NotFoundDeviceByIdentifierErrorMessage
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'.
Error: 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'.
    at Object.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:16:23)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/nativescript-cli.js:16:18)
    at Module._compile (module.js:570:32)

iOS (If I run directly from Xcode instead of from command line, it works):

luanafernandes$ tns run ios --log trace

Support for Node.js ^6.0.0 is deprecated and will be removed in one of the next releases of NativeScript. Please, upgrade to the latest Node.js LTS version. 

Loading extensions.
Asserting extension nativescript-cloud is installed.
Extension nativescript-cloud is installed.
Asserting extension nativescript-starter-kits is installed.
Extension nativescript-starter-kits is installed.
Trying to get macOS version.
Exec system_profiler SPSoftwareDataType -detailLevel mini 
 stdout: Software:

    System Software Overview:

      System Version: macOS 10.13.3 (17D102)
      Kernel Version: Darwin 17.4.0
      Time since boot: 18 minutes


 stderr: 
macOS version based on system_profiler is 10.13.
System information:
{ platform: 'darwin',
  shell: '/bin/bash',
  os: 'Darwin Admins-MacBook-Pro.local 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64\n',
  procArch: 'x64',
  nodeVer: '6.11.4',
  npmVer: '3.10.10',
  nodeGypVer: null,
  nativeScriptCliVersion: '4.1.1',
  gitVer: '2.16.2',
  dotNetVer: null,
  javacVersion: '1.8.0_172',
  adbVer: '1.0.40',
  androidInstalled: true,
  monoVer: null,
  gradleVer: null,
  isAndroidSdkConfiguredCorrectly: true,
  xcodeVer: undefined,
  xcodeprojLocation: '/usr/local/bin/xcodeproj',
  itunesInstalled: true,
  cocoaPodsVer: '1.5.3',
  isCocoaPodsWorkingCorrectly: true,
  isCocoaPodsUpdateRequired: false,
  pythonInfo: { isInstalled: true, isSixPackageInstalled: true } }
Looking for project in '/Users/luanafernandes/Documents/GitHub/LCGConnect'
Project directory is '/Users/luanafernandes/Documents/GitHub/LCGConnect'.
Initializing analytics statuses.
Analytics statuses:  { TrackFeatureUsage: 'enabled', TrackExceptions: 'enabled' }
Will send the following information to Google Analytics: { type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'event',
  action: 'Check Local Build Setup',
  label: 'Starting',
  customDimensions: { cd5: 'CLI' } }
spawn: node "/usr/local/lib/node_modules/nativescript/lib/services/analytics/analytics-broker-process.js" "/usr/local/lib/node_modules/nativescript/lib/bootstrap.js"
Will send the following information to Google Analytics: { type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'event',
  action: 'Check Local Build Setup',
  label: 'Warnings:WARNING: Xcode is not installed or is not configured properly.',
  customDimensions: { cd5: 'CLI' } }
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✖ WARNING: Xcode is not installed or is not configured properly. 
 You will not be able to build your projects for iOS or run them in the iOS Simulator.
To be able to build for iOS and run apps in the native emulator, verify that you have installed Xcode. 

Will send the following information to Google Analytics: { type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'event',
  action: 'Check Local Build Setup',
  label: 'Finished: Is setup correct: false',
  customDimensions: { cd5: 'CLI' } }
You have nativescript-cloud extension installed, so you can execute cloud builds, but your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: 
Select "Configure for Local Builds" to run the setup script and automatically configure your environment for local builds.
Select "Skip Step and Configure Manually" to disregard this option and install any required components manually.
You have nativescript-cloud extension installed, so you can execute cloud builds, but your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: 
Select "Configure for Local Builds" to run the setup script and automatically configure your environment for local builds.
Select "Skip Step and Configure Manually" to disregard this option and install any required components manually.
Will send the following information to Google Analytics: { type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'event',
  action: 'Check Environment Requirements',
  label: 'User should select: You have nativescript-cloud extension installed, so you can execute cloud builds, but your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: \nSelect "Configure for Local Builds" to run the setup script and automatically configure your environment for local builds.\nSelect "Skip Step and Configure Manually" to disregard this option and install any required components manually.',
  customDimensions: { cd5: 'CLI' } }
? To continue, choose one of the following options:  Skip Step and Configure ManWill send the following information to Google Analytics: { type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'event',
  action: 'Check Environment Requirements',
  label: 'User selected: Skip Step and Configure Manually',
  customDimensions: { cd5: 'CLI' } }
To be able to build for iOS, verify that your environment is configured according to the system requirements described at http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-os-x.html#system-requirements. In case you have any questions, you can check our forum: 'http://forum.nativescript.org' and our public Slack channel: 'https://nativescriptcommunity.slack.com/'.
Error: To be able to build for iOS, verify that your environment is configured according to the system requirements described at http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-os-x.html#system-requirements. In case you have any questions, you can check our forum: 'http://forum.nativescript.org' and our public Slack channel: 'https://nativescriptcommunity.slack.com/'.
    at Object.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:16:23)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/nativescript-cli.js:16:18)
    at Module._compile (module.js:570:32)

Anyone has an idea of what's going on?
Thank you!

needs more info

Most helpful comment

Thank you so much @tsonevn !
My xcode wans't selected in the command line tools, to fix it I opened my xcode in preferences->locations and selected it..
Also I updated every single module and deleted and add the platforms again.
Now it works.
Thank you very much!

All 2 comments

Hi @lumayara,
Make sure that you are using latest NativeScript 4.1.2 and the latest node LTS version 8.11.3.
If you are using an older one, please update the NS CLI and check if you will be able to build and deploy the app on the simulator.
You can also try to start the simulator manually and then run tns run ios command.

If this solves the case, you can update the project dependencies to the latest available ones.

{
    "description": "NativeScript Application",
    "license": "SEE LICENSE IN <your-license-filename>",
    "readme": "NativeScript Application",
    "repository": "<fill-your-repository-here>",
    "nativescript": {
        "id": "",
    },
    "dependencies": {
        "@angular/animations": "~6.0.0",
        "@angular/common": "~6.0.0",
        "@angular/compiler": "~6.0.0",
        "@angular/core": "~6.0.0",
        "@angular/forms": "~6.0.0",
        "@angular/http": "~6.0.0",
        "@angular/platform-browser": "~6.0.0",
        "@angular/platform-browser-dynamic": "~6.0.0",
        "@angular/router": "~6.0.0",
        "nativescript-angular": "~6.0.0",
        "nativescript-theme-core": "~1.0.4",
        "reflect-metadata": "~0.1.8",
        "rxjs": "~6.1.0",
        "tns-core-modules": "~4.1.0",
        "zone.js": "^0.8.26"
    },
    "devDependencies": {
        "babel-traverse": "6.26.0",
        "babel-types": "6.26.0",
        "babylon": "6.18.0",
        "lazy": "1.0.11",
        "nativescript-dev-typescript": "~0.7.0",
        "typescript": "~2.7.2"
    }
}

Thank you so much @tsonevn !
My xcode wans't selected in the command line tools, to fix it I opened my xcode in preferences->locations and selected it..
Also I updated every single module and deleted and add the platforms again.
Now it works.
Thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

triniwiz picture triniwiz  Â·  3Comments

manojdcoder picture manojdcoder  Â·  3Comments

bnussey picture bnussey  Â·  3Comments

Sulman633 picture Sulman633  Â·  3Comments

tsonevn picture tsonevn  Â·  3Comments