7

I dont know since when this happened, maybe after the upgrade to Mac OS Lion and Xcode 4.1. But I am not sure.

I have quite a large project for iOS which is constrained by the Game Center / Game Kit. I get straight to the point: On the simulator I just can not connect to the Game Center anymore. Even when I open up the "Game Center"-App on the simulator and click on "Create Account" for example I get the error message: "Game Center account services are currently unavailable. Please try again later."

I already googled for a few days, here is what I tried:

  • I configured my router like Apple says in the documentation, although it did work before the configuations a few weeks ago. I also checked different networks / Routers.

  • I completely deleted the XCode Developer tools (the whole /Developer/-Folder) and the iPhone Simulator cahce in ~/Library/Application Support/iPhone Simulator and reinstalled everything

  • of course I resettet the device plenty of times

The Simulator has an internet-connection. When I open up Safari I can browse the net.

Thank you, I really would apprecheate any help or advice! Fabian

chown
  • 51,908
  • 16
  • 134
  • 170
Fabi
  • 73
  • 1
  • 4
  • Fabian, I'm having this EXACT same problem. It happened after I upgraded OSX to Lion and XCode to 4.1; If you find the problem please post an answer here. I can't find any help in google either. – Damian Sep 04 '11 at 03:32

1 Answers1

10

According to this thread:
https://discussions.apple.com/thread/3206110?start=0&tstart=0

the solution should be to reset your hosts file (in /private/etc/hosts) and the connection should work again

default hosts file should look like this:

##
# 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

anyway, it would be helpful, if you provide us some debug, like

NSLog(@"%@",[error description])

where error is of type NSError from NSHTTPURLResponse sendSynchronousRequest:

Marek Sebera
  • 39,650
  • 37
  • 158
  • 244
  • oh my god, I could have thought about this earlier! Thank you very very much Marek Sebera!!! I had some manual entries from connections I tried to avoid in my hosts .... One of these connections must have disabled game center -.- This took so much time .... Thanks again! I love Stackoverflow ;-) – Fabi Sep 06 '11 at 10:30
  • I'm glad to help you. If my answer is correct, please, mark it as `right answer`, see FAQ: http://stackoverflow.com/faq#howtoask – Marek Sebera Sep 06 '11 at 10:33
  • 1
    THANKS A LOT!! This was driving me crazy. In my case the two lines in the hosts file that was causing the problem was: "127.0.0.1 CRL.VERISIGN.NET" and "127.0.0.1 OCSP.SPO1.VERISIGN.COM". I don't think I've added that. – Damian Sep 06 '11 at 20:53
  • 1
    Removed "127.0.0.1 CRL.VERISIGN.NET" and it worked for me too. Thanks a lot! – anka Jan 21 '12 at 23:39
  • My hosts file is locked and OS would not allow me to edit it. Moreover that file is full of [**garbage**](http://i.stack.imgur.com/sqnQp.png). It creates duplicate file if I try to make chages there. – rohan-patel Jan 22 '13 at 12:34
  • @rohan-patel you must login as root, if using OSX and Terminal (as I see you do), use `sudo bash`, login with root password and then `nano` or `vi/vim` on `/private/etc/hosts` – Marek Sebera Jan 22 '13 at 12:42