Skip to content

NativeScript cli error when tns run ios or any command related to IOS platform #3189

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
tsonevn opened this issue Nov 1, 2017 · 31 comments
Closed

Comments

@tsonevn
Copy link
Contributor

tsonevn commented Nov 1, 2017

From @fawzywassel on October 31, 2017 18:6

cli error =>
NativeScript can only run in Xcode version 6.0 or greater

Copied from original issue: NativeScript/NativeScript#5015

@tsonevn tsonevn added the os: ios label Nov 1, 2017
@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @NathanaelA on October 31, 2017 19:17

@fawzywassel -- Do you have XCode 8 or 9 installed?
See: https://docs.nativescript.org/start/quick-setup

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @fawzywassel on October 31, 2017 19:33

yes i have XCode 9 , and i follow this steps and all is installed perfect

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @fawzywassel on October 31, 2017 19:35

screen shot 2017-10-31 at 9 34 42 pm

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @fawzywassel on October 31, 2017 19:37

screen shot 2017-10-31 at 9 36 47 pm
this is my xcode version

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @NathanaelA on October 31, 2017 20:11

A couple things you can try:

  1. what does xcodebuild -version say?
  2. what does c++ --version say?
  3. What does tns doctor say?

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @fawzywassel on October 31, 2017 20:15

xcodebuild -version
Xcode 9.0
Build version 9A235
c++ --version
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin17.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
tns doctor
Your components are up-to-date:
nativescript,tns-core-modules,tns-android,tns-ios

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @NathanaelA on October 31, 2017 20:49

@fawzywassel - Everything looks correct based on that. So when you do a

  • tns create name
  • cd name
  • tns platform add ios
  • tns build ios

You get that error, correct? , this is from a brand new project correct?

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @fawzywassel on October 31, 2017 20:51

yes

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @NathanaelA on October 31, 2017 20:54

Can you do a tns info?

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @fawzywassel on October 31, 2017 20:55

screen shot 2017-10-31 at 10 55 20 pm

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @fawzywassel on October 31, 2017 21:2

this issue happen when i trying to add/remove/build/prepare ios

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

From @NathanaelA on October 31, 2017 21:28

@tsonevn - Any ideas? This also probably needs to be moved to the CLI repo...

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

Hi @fawzywassel
Could you try to open a Xcode, create a new native project and build it on iOS Simulator? This will help to verify, whether everything is properly configured. If everything works correctly, please try again to create a project and to build it, while following the above-given instructions.

Also, could you run xcode-select -v and to provide, what does the command say?

@fawzywassel
Copy link

xcode-select -v
xcode-select version 2349.

@fawzywassel
Copy link

xcode new gererate native apps work normaly with no errors

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 1, 2017

@fawzywassel

We are still unable to recreate this behavior on our side, which makes the research on the problem hard. Something that you could check on your side is if the correct path is set up for the Xcode while running xcode-select -p. The command should return a string similar to the below attached one:

/Applications/Xcode.app/Contents/Developer

Also, you could verify, the returned Xcode version in the terminal via xcodebuild -version and to check if it is the correct one.

@fawzywassel
Copy link

xcode-select -p Yes, it returned the same you suggest
xcodebuild -version
Xcode 9.0
Build version 9A235

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 2, 2017

Hi @fawzywassel,
Thank you for your suggestion, however, at this point, a remote session is not applicable. After the research we made with our developers on our side this issue seems to be related to your local environment setting and in our further investigation we found that the issue should be related to the info parsing after executing xcodebuild -version | head -n 1 | sed -e 's/Xcode //'.

Regarding that please run xcodebuild -version | head -n 1 | sed -e 's/Xcode //' again, while using all arguments after the command and send us the output.

Thank you in advance for your cooperation.

@fawzywassel
Copy link

screen shot 2017-11-04 at 12 23 02 am

@fawzywassel
Copy link

@tsonevn please help me .....

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 7, 2017

Hi @fawzywassel,
After reviewing the log from the error from the console, I found that the problem could be related to the overwriting the head command in the machine. The current command does not have -n option, which is needed to run the build.

To confirm that this is the case you could run the following commands and verify if the log on your side will be the same.
which head ->result /usr/bin/head
ls -la /usr/bin/he ->result No such file or directory
ls -la /usr/bin/head ->result -rwxr-xr-x 1 root wheel 18864 23 Mar 2017 /usr/bin/head

If there is a difference. you could run the following command in the terminal:
export PATH=/usr/bin/head:$PATH
The command will set up the path to the needed head, while merging it with the current one.

After that try to build an application in the same tab while using tns run ios

@fawzywassel
Copy link

fawzywassel commented Nov 7, 2017

@tsonevn
after run all command only one is not the same
which head result is /Applications/XAMPP/xamppfiles/bin/head
and still the same after run export PATH=/usr/bin/head:$PATH

@tsonevn
Copy link
Contributor Author

tsonevn commented Nov 7, 2017

Hi @fawzywassel,
Could you execute one more time the following command export PATH=/usr/bin/head? This time close the terminal and open it again. Then run echo $PATH and validate that the same path(/usr/bin/head) is printed.

If the path is correct, run xcodebuild -version | head -n 1 | sed -e 's/Xcode //' command, to verify if the correct version of the Xcode will be printed.

After that delete node_modules and platforms folders and rebuild the app with tns run ios

@fawzywassel
Copy link

@tsonevn
Thanks for your support
its working now

@tsonevn tsonevn closed this as completed Nov 8, 2017
@narayananl23
Copy link

I had the same issue and this solved mine

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

reference https://github.com/nodejs/node-gyp/issues/569

@hedza06
Copy link

hedza06 commented Jan 13, 2018

@narayananl23 also working for me. Thank you!

@mrisek
Copy link

mrisek commented Feb 14, 2018

I faced the same scenario after fresh install of Xcode 9.2. Thanks @narayananl23 for a solution!

@aleangelico
Copy link

@narayananl23 this worked for me too, thanks!

@burkeholland
Copy link

@narayananl23 Worked for me as well! Thank you so much.

@QuantumPixelForge
Copy link

But for me is still not working, i have tried all things what is mentioned here. Here is my stackoverflow ticket https://stackoverflow.com/questions/54873245/nativescript-can-only-run-in-xcode-version-6-0-or-greater.

@QuantumPixelForge
Copy link

any news about this issue?

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

No branches or pull requests

9 participants