godot-sdk-integrations / godot-ios-plugins

MIT License
130 stars 52 forks source link

Game Center plugin linker error with iOS export using Godot 4.3 #70

Open RocketRonz opened 1 month ago

RocketRonz commented 1 month ago

After upgrading to Godot 4.3.rc2, the iOS export fails when I include the Game Center plugin:

Undefined symbols for architecture arm64:
  "Object::get_argument_options(StringName const&, int, List<String, DefaultAllocator>*) const", referenced from:
      vtable for GameCenter in gamecenter-device.debug.a[arm64][3](game_center.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** ARCHIVE FAILED **

The same project exports fine with the plugin using Godot 4.2.2

My guess is that I need to checkout the Godot 4.3 submodule before building the libraries but there is no 4.3 branch available in GitHub yet. Is this just a case of waiting until a stable version of 4.3 is released? Thanks for any help.

owlnewworlds commented 1 month ago

You can checkout the commit of any release, I'm trying myself to make the Game Center plugin work and I passed through that stage by doing a checkout of the Godot source code 4.3 RC 3.

Now, when I call the authenticate function, it returns a null result and it doesn't work. If by any case, you happen to make a successfull authenticate call, let me know ^^'

RocketRonz commented 1 month ago

The easiest solution for me was to revert my Godot project and code back to the latest stable version (4.2.2) as I need to focus my efforts on creating a game. The plugin might still need some work to support 4.3 as it is still a preview build, seems to work fine with 4.2.2 though.

RocketRonz commented 1 month ago

Ok, so uploading a 4.2.2 build to TestFlight doesn't work (ITMS-90426 error), so I've gone back to 4.3 RC3. Now there is a 4.3 branch available for the Godot submodule so I've rebuilt the plugin libraries and the export now works.

When running on my phone from Godot, the Game Center authenticate call did nothing but there were no obvious console errors. I opened the Xcode project file and ran my app from there and the following error appeared in the Xcode console:

Could not load services for GameKit. This likely means your game is missing the com.apple.developer.game-center entitlement...

Click on the Signing & Capabilities tab, then +Capability and double click on "Game Center" to create a new entitlements file. This fixed the Game Center authenticate call for me but I'm getting a not yet live message when I try and view my leaderboard. Hope this helps.

owlnewworlds commented 1 month ago

Ok, so uploading a 4.2.2 build to TestFlight doesn't work (ITMS-90426 error), so I've gone back to 4.3 RC3. Now there is a 4.3 branch available for the Godot submodule so I've rebuilt the plugin libraries and the export now works.

When running on my phone from Godot, the Game Center authenticate call did nothing but there were no obvious console errors. I opened the Xcode project file and ran my app from there and the following error appeared in the Xcode console:

Could not load services for GameKit. This likely means your game is missing the com.apple.developer.game-center entitlement...

Click on the Signing & Capabilities tab, then +Capability and double click on "Game Center" to create a new entitlements file. This fixed the Game Center authenticate call for me but I'm getting a not yet live message when I try and view my leaderboard. Hope this helps.

Yes it works like that. And if you try a post_score call you will see its working too despite the not live yet warnings ^^

nrgbypass commented 3 weeks ago

Hi guys, I'm a bit late to the party but I have the same issue and I'm pretty blocked and desperate to get it working . Do you mind sharing the steps of what made it work for you ? The more details the better. Thank you so much in advance. @owlnewworlds @RocketRonz

RocketRonz commented 3 weeks ago

I pretty much followed these guides but checked out the Godot 4.3 branch when building the plugin:

https://www.peanuts-code.com/en/tutorials/gd0021_game_center_plugin/ https://www.peanuts-code.com/en/tutorials/gd0022_implement_game_center/

It's a bit convoluted but does the job. Would be great to run directly from Godot but I couldn't get the plugin to work without manually adding it in Xcode. Hope this helps.