XCode build fail when add Apple.GameKit plugin for Unity: Undefined symbol

438 Views Asked by At

I have a Unity project, after setting up Apple.Gamekit plugin, it show up some error when build with XCode:

...
_GKTurnBasedMatch_GKTurnBasedMatch_SetMatchEndedCallback_m910C3F81D2AC3130B65F3F62FC964A7AB1BB4BB4 in Apple.GameKit.o
      _GKTurnBasedMatch__cctor_m700F9804CBB4DB33EDE51763CB6CE3D5DCA9005C in Apple.GameKit.o
     (maybe you meant: _GKTurnBasedMatch_GKTurnBasedMatch_SetMatchEndedCallback_m910C3F81D2AC3130B65F3F62FC964A7AB1BB4BB4)
  "_NSArray_Free", referenced from:
      _NSArray_NSArray_Free_mC93688296693996DD20C704745DBDB169462AA95 in Apple.Core.o
      _NSArray_OnDispose_m3D3F7A2BCD4038EB98125421A35CA23FCA9FF395 in Apple.Core.o
     (maybe you meant: _NSArray_NSArray_Free_mC93688296693996DD20C704745DBDB169462AA95)
  "_GKLeaderboard_SubmitScore", referenced from:
      _GKLeaderboard_GKLeaderboard_SubmitScore_m2B37BEF38FD1A631ED4A06A894B7360A9ECDFF47 in Apple.GameKit.o
      _GKLeaderboard_SubmitScore_m857EAFCB86A50F186998E8A78A22778F4AE961BD in Apple.GameKit.o
     (maybe you meant: GKLeaderboard_GKLeaderboard_SubmitScore_m2B37BEF38FD1A631ED4A06A894B7360A9ECDFF47, GKLeaderboard_SubmitScore_m857EAFCB86A50F186998E8A78A22778F4AE961BD )
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Showing Recent Messages
Undefined symbol: _NSArray_GetGKTurnBasedExchangeReplyAt

Showing Recent Messages
Undefined symbol: _NSArray_GetGKLeaderboardEntryAt

Showing Recent Messages
Undefined symbol: _NSArray_GetGKLeaderboardAt

The plugin I added, which is provided by Apple: https://github.com/apple/unityplugins

What I tried so far:

  • Re-install Apple.Core and Apple.GameKit
  • Re-install pod
  • Update XCode to version 14.1

But nothing works.

Please help! Thank you!!!

1

There are 1 best solutions below

0
pogush On

Make sure to have the suggested unity version (2020.3.33f1) installed when you compile the plugins, otherwise they won't compile correctly.

See the requirements here: https://github.com/apple/unityplugins/blob/main/Documentation/BuildScript.md