2

After upgrading my SpriteKit project to Swift 2 with Xcode 7 beta, I'm getting the following runtime error:

dyld: Library not loaded: /System/Library/Frameworks/GameplayKit.framework/GameplayKit
  Referenced from: /private/var/mobile/Containers/Bundle/Application/MyGame.app/Frameworks/libswiftGameKit.dylib
  Reason: image not found
(lldb) 

I don't use GameplayKit in my project although I do use SpriteKit.

sfdrew
  • 155
  • 2
  • 9
  • Did you ever fix this issue? I have it as well. No suggestions here worked, setting GameKit to optional did not work either. – hawkfalcon Jun 19 '15 at 00:35
  • I still have the issue. About to try Xcode 7 beta 2. – sfdrew Jul 02 '15 at 23:40
  • I upgraded it too once. It was the worst step i ever took. I just deleted xcode 7 beta and just edited the code back to xcode 6. Took me like a month to fix it because xcode 6 has somehow changed and the error was somewhere other than where the editor showed. I would advise you to delete Xcode 7 BETA cause Xcode 6 doesn't have those errors. – Aryaman Goel Jul 08 '15 at 02:05
  • UPDATE: As of Xcode 7 beta 3, there is a new GameCenter.framework. This lets me run my app in the simulator using iOS 9, but I have yet to get the game to run on my iOS 8.4 device, even after copying over the 8.4 DeviceSupport into the Xcode 7 beta 3 app. – sfdrew Jul 09 '15 at 00:35
  • The error I get on iOS 8.4: <<< Library not loaded: /System/Library/Frameworks/GameCenter.framework/GameCenter Reason: image not found >>> Which makes sense since GameCenter.framework is new in iOS 9. Is there some way to make this GameKit for 8.4 and earlier? – sfdrew Jul 09 '15 at 00:41

3 Answers3

1

dylib isn't there anymore. GameKit.tbd is what is now in the GameKit framework. Click on Show in Finder on the GameKit framework from the project navigator. Open the GameKit.Framework folder you should have the following files:

GameKit.tbd
Headers
Modules
module.map

If you don't see that, just delete reference and re-add it.

Check the LIBRARY SEARCH PATH under the Build Settings and remove any path that would lead to this library being included. In fact remove everything and re-add as needed.

John Difool
  • 5,572
  • 5
  • 45
  • 80
  • 1
    The GameKit framework is the 9.0 one. Removed it and re-linked it and still seeing the same error. All of the project and target search paths are clean. – sfdrew Jun 17 '15 at 20:02
  • 1
    Okay, first I am assuming that GameKit is added to the Build Phase of "Link Libraries with Frameworks" right? It's probably marked as "Required" on the right side. Make it optional just to test the compile and if this is related. Next add this framework to "Copy Bundle Resources" just to test if this works. Then check the Build Settings for 'Implicitly link objective-c runtime support'. – John Difool Jun 17 '15 at 20:54
1

if your target machine's iOS version lower 9.0,change iPhones iOs to 9.0 and test.

XCode:SDK is 9.0,TARGET is 8.3

my iPhone is 8.3:dyld: Library not loaded my iPad is 9.0:OK! simulator:OK

Tinyan
  • 11
  • 1
1

There seems to be a bug in iOS 9 beta SDK that forces the requirement of GamePlayKit when GameKit framework is added. A bug report needs to be filed as GameKit and GamePlayKit are totally unrelated.

As a temporary solution i would suggest to download iOS 8 sdk and change the base target sdk to iOS 8 until this is fixed by apple. Otherwise upgrade iOS version of your device to iOS 9 beta.

GamePlayKit is iOS 9 only framework and hence cannot be added in the embedded binaries section too.


EDIT:

Apple seems to have changed the framework name in iOS 9. Instead of import GameKit try import GameCenter

johnny peter
  • 4,634
  • 1
  • 26
  • 38