Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dede95064

macrumors newbie
Original poster
Mar 23, 2014
3
0
I get the above error in Xcode when it tries to run the basic Hello World program. It builds it fine but then Xcode crashes.

I have scoured the internet for a solution. The closest was making sure my Hosts file has the following:

127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost

I still have the problem though.

Any ideas?

Thanks!
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,419
5,767
Have you tried restarting your computer? I have this error pop up once a year or so it seems and it always vanishes after a restart as far as I can recall.
 

dede95064

macrumors newbie
Original poster
Mar 23, 2014
3
0
Yes, I have restarted it multiple times, reinstalled Xcode, flushed the dns cache, checked the other hosts files, and still nothing...
 

Partron22

macrumors 68030
Apr 13, 2011
2,655
802
Yes
do you have a linefeed after fe80::1%lo0 localhost like you should, or an extra one up top? hosts can be picky about that.
 

dede95064

macrumors newbie
Original poster
Mar 23, 2014
3
0
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
//I have an empty space here.


If by linefeed you mean an extra line of space, I only have one at the bottom.
 

DennisBlah

macrumors 6502
Dec 5, 2013
485
2
The Netherlands
Sorry for bumping up an 'older' post like this.

But because I faced the same problem today, I just wanna post the solution.
I'll start with my scenario why the error came up.

I'm trying to make an 'proxy-script' inside the hosts file.
And use my autoupdater application to copy it to /etc/

for testing, I took my original one, and putted it on my share, and removed the original one from /etc/

After I done this, I couldn't launch my apps anymore from within xcode.
So... I copied back my hosts file to /etc/

Guess what? It did not solved the issue.

I rebooted, and done a disk permission repair on my drive, and it fixed the permissions of my hosts file :)

Solved!

Hopefully this will help any future coders which are facing the same issue. Since this was a top hit on google on this error.


Code:
process launch failed: invalid hoststring '(null)'
Its a permission error on your /etc/hosts file!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.