Skip to content

Executing tns platform add ios throws incorrect exception when XCode is not installed #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
leebailey88 opened this issue Mar 9, 2015 · 12 comments
Labels
Milestone

Comments

@leebailey88
Copy link

$ tns platform add ios
Version strings are not in the same format

This is from the getting started guide. This should be the most critical bug as potential users like me are instantly turned off and may not revisit the project if we can't even get the hello world app running.

@rosen-vladimirov
Copy link
Contributor

Hi @leebailey88,
I'm sorry you've received such error. In order to help you, I would like to ask you for more information on this case:

  1. What is your version of XCode? Could you provide the output of the following command: xcodebuild -version | head -n 1 | sed -e 's/Xcode //'
  2. Can you run $ tns platform add ios --log trace and send us the output of the command.

It looks like there's something strange when we try to check your XCode version and see if it is supported one (min supported version is 6.0)

@leebailey88
Copy link
Author

ah, that's the first issue. I only have command line tools installed--not Xcode itself. I didn't see that as a prerequisite in the docs. Though that may be obvious to seasoned app developers, newbies like me who barely know what Xcode is should probably be explicitly told to DL it before starting here.

@rosen-vladimirov
Copy link
Contributor

@leebailey88 , you can check the system requirements here http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-os-x.html#system-requirements
We'll try to improve the error message, as the current one doesn't help you to understand that you have to install latest XCode. Thank you for the information.
I suggest to rename this issue to "Executing tns platform add ios throws incorrect exception when XCode is not installed", what do you think about this?

@leebailey88 leebailey88 changed the title Executing tns platform add ios throws exception Executing tns platform add ios throws incorrect exception when XCode is not installed Mar 10, 2015
@leebailey88
Copy link
Author

Thanks for the quick responses. Renamed issue and downloading Xcode now

@leebailey88
Copy link
Author

I see from the link that Xcode is clearly listed as a requirement so this was definitely a case of user error. A better error message would help greatly though. I tend to skip straight to the enumerated steps when using getting started guides which is how I missed it here.

@ghost
Copy link

ghost commented Mar 8, 2016

I got the same error though Xcode 7.3 beta & the command line tools are installed

@ickata
Copy link

ickata commented May 27, 2016

Same error here.

$ node --version
v5.11.1

$ xcodebuild -version
Xcode 6.3.1
Build version 6D1002

$ tns platform add ios --log trace
execFile: /usr/local/opt/android-sdk/platform-tools/adb "help"
spawn: /usr/local/opt/android-sdk/tools/android "--help"
Result when throw error is false:
{ stdout: '\n       Usage:\n       android [global options] action [action options]\n       Global options:\n  -s --silent     : Silent mode, shows errors only.\n  -v --verbose    : Verbose mode, shows errors, warnings and all messages.\n     --clear-cache: Clear the SDK Manager repository manifest cache.\n  -h --help       : Help on a specific command.\n\n                                                                    Valid\n                                                                    actions\n                                                                    are\n                                                                    composed\n                                                                    of a verb\n                                                                    and an\n                                                                    optional\n                                                                    direct\n                                                                    object:\n-    sdk              : Displays the SDK Manager window.\n-    avd              : Displays the AVD Manager window.\n-   list              : Lists existing targets or virtual devices.\n-   list avd          : Lists existing Android Virtual Devices.\n-   list target       : Lists existing targets.\n-   list device       : Lists existing devices.\n-   list sdk          : Lists remote SDK repository.\n- create avd          : Creates a new Android Virtual Device.\n-   move avd          : Moves or renames an Android Virtual Device.\n- delete avd          : Deletes an Android Virtual Device.\n- update avd          : Updates an Android Virtual Device to match the folders\n                        of a new SDK.\n- create project      : Creates a new Android project.\n- update project      : Updates an Android project (must already have an\n                        AndroidManifest.xml).\n- create test-project : Creates a new Android project for a test package.\n- update test-project : Updates the Android project for a test package (must\n                        already have an AndroidManifest.xml).\n- create lib-project  : Creates a new Android library project.\n- update lib-project  : Updates an Android library project (must already have\n                        an AndroidManifest.xml).\n- create uitest-project: Creates a new UI test project.\n- update adb          : Updates adb to support the USB devices declared in the\n                        SDK add-ons.\n- update sdk          : Updates the SDK by suggesting new platforms to install\n                        if available.\n',
  stderr: '',
  exitCode: 1 }

       Usage:
       android [global options] action [action options]
       Global options:
  -s --silent     : Silent mode, shows errors only.
  -v --verbose    : Verbose mode, shows errors, warnings and all messages.
     --clear-cache: Clear the SDK Manager repository manifest cache.
  -h --help       : Help on a specific command.

                                                                    Valid
                                                                    actions
                                                                    are
                                                                    composed
                                                                    of a verb
                                                                    and an
                                                                    optional
                                                                    direct
                                                                    object:
-    sdk              : Displays the SDK Manager window.
-    avd              : Displays the AVD Manager window.
-   list              : Lists existing targets or virtual devices.
-   list avd          : Lists existing Android Virtual Devices.
-   list target       : Lists existing targets.
-   list device       : Lists existing devices.
-   list sdk          : Lists remote SDK repository.
- create avd          : Creates a new Android Virtual Device.
-   move avd          : Moves or renames an Android Virtual Device.
- delete avd          : Deletes an Android Virtual Device.
- update avd          : Updates an Android Virtual Device to match the folders
                        of a new SDK.
- create project      : Creates a new Android project.
- update project      : Updates an Android project (must already have an
                        AndroidManifest.xml).
- create test-project : Creates a new Android project for a test package.
- update test-project : Updates the Android project for a test package (must
                        already have an AndroidManifest.xml).
- create lib-project  : Creates a new Android library project.
- update lib-project  : Updates an Android library project (must already have
                        an AndroidManifest.xml).
- create uitest-project: Creates a new UI test project.
- update adb          : Updates adb to support the USB devices declared in the
                        SDK add-ons.
- update sdk          : Updates the SDK by suggesting new platforms to install
                        if available.

Exec uname -a
 stdout: Darwin hristo-mb.bg.nc 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64

 stderr:
Exec npm -v
 stdout: 3.8.6

 stderr:
spawn: java "-version"
Exec node-gyp -v
 stdout:
 stderr: /bin/sh: node-gyp: command not found

Exec xcodebuild -version
 stdout: Xcode 6.3.1
Build version 6D1002

 stderr:
Exec gem which xcodeproj
 stdout: /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.0.0/lib/xcodeproj.rb

 stderr:
Exec pod --version
 stdout: 1.0.0

 stderr:
Exec '/usr/local/opt/android-sdk/platform-tools/adb' version
 stdout: Android Debug Bridge version 1.0.32
Revision 09a0d98bebce-android

 stderr:
spawn: /usr/local/opt/android-sdk/tools/android "-h"
Result when throw error is false:
{ stdout: '\n       Usage:\n       android [global options] action [action options]\n       Global options:\n  -s --silent     : Silent mode, shows errors only.\n  -v --verbose    : Verbose mode, shows errors, warnings and all messages.\n     --clear-cache: Clear the SDK Manager repository manifest cache.\n  -h --help       : Help on a specific command.\n\n                                                                    Valid\n                                                                    actions\n                                                                    are\n                                                                    composed\n                                                                    of a verb\n                                                                    and an\n                                                                    optional\n                                                                    direct\n                                                                    object:\n-    sdk              : Displays the SDK Manager window.\n-    avd              : Displays the AVD Manager window.\n-   list              : Lists existing targets or virtual devices.\n-   list avd          : Lists existing Android Virtual Devices.\n-   list target       : Lists existing targets.\n-   list device       : Lists existing devices.\n-   list sdk          : Lists remote SDK repository.\n- create avd          : Creates a new Android Virtual Device.\n-   move avd          : Moves or renames an Android Virtual Device.\n- delete avd          : Deletes an Android Virtual Device.\n- update avd          : Updates an Android Virtual Device to match the folders\n                        of a new SDK.\n- create project      : Creates a new Android project.\n- update project      : Updates an Android project (must already have an\n                        AndroidManifest.xml).\n- create test-project : Creates a new Android project for a test package.\n- update test-project : Updates the Android project for a test package (must\n                        already have an AndroidManifest.xml).\n- create lib-project  : Creates a new Android library project.\n- update lib-project  : Updates an Android library project (must already have\n                        an AndroidManifest.xml).\n- create uitest-project: Creates a new UI test project.\n- update adb          : Updates adb to support the USB devices declared in the\n                        SDK add-ons.\n- update sdk          : Updates the SDK by suggesting new platforms to install\n                        if available.\n',
  stderr: '',
  exitCode: 1 }
Exec mono --version
 stdout:
 stderr: /bin/sh: mono: command not found

Exec git --version
 stdout: git version 2.3.2 (Apple Git-55)

 stderr:
Exec gradle -v
 stdout:
 stderr: /bin/sh: gradle: command not found

Exec "/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/javac" -version
 stdout:
 stderr: javac 1.8.0_92

System information:
{ procInfo: 'nativescript/2.0.1',
  platform: 'darwin',
  os: 'Darwin hristo-mb.bg.nc 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64\n',
  shell: '/bin/bash',
  dotNetVer: null,
  procArch: 'x64',
  nodeVer: 'v5.11.1',
  npmVer: '3.8.6',
  javaVer: '1.8.0',
  nodeGypVer: null,
  xcodeVer: 'Xcode 6.3.1\nBuild version 6D1002\n',
  xcodeprojGemLocation: '/Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.0.0/lib/xcodeproj.rb\n',
  itunesInstalled: true,
  cocoapodVer: '1.0.0',
  adbVer: 'Android Debug Bridge version 1.0.32',
  androidInstalled: true,
  monoVer: null,
  gitVer: '2.3.2 (Apple Git-55)',
  gradleVer: null,
  javacVersion: '1.8.0_92' }
Initializing analytics statuses.
Analytics statuses:
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'platform'.
execFile: /usr/local/opt/android-sdk/platform-tools/adb "help"
Looking for project in '/Users/ickata/Desktop/Tables/tns/sample-Groceries'
Project directory is '/Users/ickata/Desktop/Tables/tns/sample-Groceries'.
Analytics statuses:
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'platform|add'.
Exec which xcodebuild
 stdout: /usr/bin/xcodebuild

 stderr:
Exec xcodebuild -version | head -n 1 | sed -e 's/Xcode //'
 stdout:
 stderr: Unknown option: n
Usage: head [-options] <url>...
    -m <method>   use method for the request (default is 'HEAD')
    -f            make request even if head believes method is illegal
    -b <base>     Use the specified URL as base
    -t <timeout>  Set timeout value
    -i <time>     Set the If-Modified-Since header on the request
    -c <conttype> use this content-type for POST, PUT, CHECKIN
    -a            Use text mode for content I/O
    -p <proxyurl> use this as a proxy
    -P            don't load proxy settings from environment
    -H <header>   send this HTTP header (you can specify several)

    -u            Display method and URL before any response
    -U            Display request headers (implies -u)
    -s            Display response status code
    -S            Display response status chain
    -e            Display response headers
    -d            Do not display content
    -o <format>   Process HTML content in various ways

    -v            Show program version
    -h            Print this message

    -x            Extra debugging output

Error: Version strings are not in the same format
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:535:15)
    at /usr/local/lib/node_modules/nativescript/lib/common/errors.js:123:33
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/common/services/commands-service.js:84:106
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/common/yok.js:208:124
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/common/services/commands-service.js:51:55
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/common/errors.js:123:33
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    - - - - -
    at Object.versionCompare (/usr/local/lib/node_modules/nativescript/lib/common/helpers.js:79:15)
    at /usr/local/lib/node_modules/nativescript/lib/services/ios-project-service.js:100:25
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:61:47
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:46:59
    at arrayEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/index.js:1289:13)
    at Function.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/lodash/index.js:3345:13)
    at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:45:15
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/commands/add-platform.js:11:55
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
Analytics statuses:
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'help'.
List of registered commands: /?, appstore, appstore|upload, autocomplete, autocomplete|disable, autocomplete|enable, autocomplete|status, build, build|android, build|ios, create, debug, debug|android, debug|ios, deploy, dev-generate-help, dev-generate-messages, dev-post-install, dev-preuninstall, dev-test, dev-test|android, dev-test|ios, device, device|android, device|get-file, device|ios, device|list-applications, device|list-files, device|log, device|put-file, device|run, device|stop, device|uninstall, doctor, emulate, emulate|android, emulate|ios, error-reporting, help, info, init, install, livesync, platform, platform|*list, platform|add, platform|remove, platform|update, plugin, plugin|add, plugin|find, plugin|remove, plugin|search, prepare, publish, publish|ios, run, run|android, run|ios, test, test|android, test|init, test|ios, usage-reporting
Reading help for command 'platform|add'. FileName is 'platform-add.md'.
# platform add
┌──────────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Usage                    │ Synopsis                                                                                                                                        │
│ Android latest runtime   │ $ tns platform add android [--framework-path <File Path>] [--symlink] [--sdk <API Level>] [--platform-template <Platform Template>]             │
│ Android selected runtime │ $ tns platform add android[@<Version>] [--framework-path <File Path>] [--symlink] [--sdk <API Level>] [--platform-template <Platform Template>] │
│ iOS latest runtime       │ $ tns platform add ios [--framework-path <File Path>] [--symlink]                                                                               │
│ iOS selected runtime     │ $ tns platform add ios[@<Version>] [--framework-path <File Path>] [--symlink] [--platform-template <Platform Template>]                         │
└──────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Configures the current project to target the selected platform.

### Options

    * --framework-path - Sets the path to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If --symlink is specified, <File Path> must point to directory in which the runtime is already extracted. If --symlink is not specified, <File Path> must point to a valid npm package.
    * --symlink - Creates a symlink to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If --frameworkPath is specified, creates a symlink to the specified directory. If --frameworkPath is not specified, creates a symlink to platform runtime installed with your current version of NativeScript.
    * --sdk - Sets the target Android SDK for the project.
    * --platform-template - Sets the platform template that will be used for the native application.

### Attributes

    * <API Level> is a valid Android API level. For example: 17, 19, MNC.
    * <File Path> is the complete path to a valid npm package or a directory that contains a NativeScript runtime for the selected platform.
    * <Platform Template> is a valid npm package, path to directory, .tgz or GitHub URL that contains a native Android or iOS template.
    * <Version> is any available version of the respective platform runtime published in npm.

Analytics statuses:
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track exception with message 'Version strings are not in the same format'.

MacOSX version 10.11.5 (15F34) (El Capitan)

@enchev enchev self-assigned this May 30, 2016
enchev pushed a commit that referenced this issue May 30, 2016
@enchev enchev added this to the 2.1 (Under consideration) milestone May 30, 2016
@enchev enchev closed this as completed in 117ecd1 May 30, 2016
enchev added a commit that referenced this issue May 30, 2016
@enchev
Copy link
Contributor

enchev commented Jun 9, 2016

Resolved here: #1782

@vip-git
Copy link

vip-git commented Oct 23, 2016

This is not fixed yet. i seem to be getting a similar error as n being a unknown option when using head.

from what i can see in this commit :

This only adds exception for try catching the error . Although the best option would be to do a regex on the version string. :)

@vip-git
Copy link

vip-git commented Oct 23, 2016

@ickata @rosen-vladimirov or @enchev any guidance on how to overcome this error ?

@vip-git
Copy link

vip-git commented Oct 23, 2016

i have fixed this for now by hardcoding the version number although best approach would be to use regex. i will send the pull request on this later.

cheers,
v

@davorpeic
Copy link

Ok, I just got this issue after I updated Xampp on my osx. I followed instructions mentioned here https://discourse.nativescript.org/t/version-strings-are-not-in-the-same-format/756/16 to rename HEAD utility in xampp bin folder, I renamed to 'xhead', apache is working fine and I can add platform with no issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants