leecrossley / cordova-plugin-game-center

Cordova / PhoneGap Game Center Plugin for Apache Cordova >= 3.0.0
http://ilee.co.uk
78 stars 29 forks source link

Can't compile on Cordova 5.1.1 #33

Closed rotoxl closed 9 years ago

rotoxl commented 9 years ago

Hi Lee,

i was trying to use your plugin but it fails on compile. Any idea? Can't use it at all

Instaling...

➜ ~/dev/proyectotest/ipa (master) cordova plugin add https://github.com/leecrossley/cordova-plugin-game-center.git

Fetching plugin "https://github.com/leecrossley/cordova-plugin-game-center.git" via git clone
Repository "https://github.com/leecrossley/cordova-plugin-game-center.git" checked out to git ref "master".
Installing "cordova-plugin-game-center" for ios

Building..

➜ ~/dev/proyectotest/ipa (master) cordova build --release
...
ker -dependency_info -Xlinker /Users/rotoxl/dev/proyectotest/ipa/platforms/ios/build/Octopus.build/Release-iphonesimulator/Octopus.build/Objects-normal/i386/Octopus_dependency_info.dat -o /Users/rotoxl/dev/proyectotest/ipa/platforms/ios/build/emulator/Octopus.app/Octopus
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_GKAchievement", referenced from:
      objc-class-ref in GameCenter.o
  "_OBJC_CLASS_$_GKGameCenterViewController", referenced from:
      objc-class-ref in GameCenter.o
  "_OBJC_CLASS_$_GKLocalPlayer", referenced from:
      objc-class-ref in GameCenter.o
  "_OBJC_CLASS_$_GKNotificationBanner", referenced from:
      objc-class-ref in GameCenter.o
  "_OBJC_CLASS_$_GKScore", referenced from:
      objc-class-ref in GameCenter.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:
    Ld build/emulator/Octopus.app/Octopus normal i386
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/rotoxl/dev/proyectotest/ipa/platforms/ios/cordova/build-release.xcconfig,-project,Octopus.xcodeproj,ARCHS=i386,-target,Octopus,-configuration,Release,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/rotoxl/dev/proyectotest/ipa/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/rotoxl/dev/proyectotest/ipa/platforms/ios/build/sharedpch
ERROR building one of the platforms: Error: /Users/rotoxl/dev/proyectotest/ipa/platforms/ios/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/rotoxl/dev/proyectotest/ipa/platforms/ios/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/Users/rotoxl/.nvm/v0.10.32/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

My cordova version is

➜ ~/dev/proyectotest/ipa (master) cordova -v
5.1.1

Thank you

leecrossley commented 9 years ago

I've repeated these exact steps with a brand new project created with Cordova 5.1.1 and get build succeeded.

You could try to re-add the platform (or create a new project) and just add this plugin. It sounds like for some reason the GameKit.framework was not referenced in Xcode -> Build Phases -> Link Binary (you can check this manually). This sometimes happens, especially if you remove and re-add plugins.

Sorry I can't help further, but it isn't an issue with this plugin. Good luck.

rotoxl commented 9 years ago

Wow, you've been fast.

I've built it from scratch and it compiled, so maybe my project was dirty. Sorry, I should have tested this before the issue.

Thank you very much, I'm going to check your plugin