iOS Build error - Undefined symbols for architecture arm64

Description of issue: iOS fails to build

Unity version: 5.5.1p2

XCode version: 8.0

Source control: GIT - Bitbucket

Local build platform: MacOS Sierra

Build target: iOS

Relevant plugins being used: Stan Assets Ultimate Mobile

Project name: Sword01

Build log (relevant chunk):
61544: [xcode] Undefined symbols for architecture arm64:
61545: [xcode] “OBJC_CLASS_MFMessageComposeViewController", referenced from: 61546: [xcode] objc-class-ref in ISN_SocialGate.o 61547: [xcode] "_OBJC_CLASS__GKNotificationBanner”, referenced from:
61548: [xcode] objc-class-ref in ISN_GameCenter.o
61549: [xcode] “OBJC_CLASS_GKFriendRequestComposeViewController", referenced from: 61550: [xcode] objc-class-ref in ISN_GameCenter.o 61551: [xcode] "_OBJC_CLASS__GKAchievementViewController”, referenced from:
61552: [xcode] objc-class-ref in ISN_GameCenter.o
61553: [xcode] “OBJC_CLASS_GKAchievement", referenced from: 61554: [xcode] objc-class-ref in ISN_GameCenter.o 61555: [xcode] "_OBJC_CLASS__GKLeaderboardSet”, referenced from:
61556: [xcode] objc-class-ref in ISN_GameCenter.o
61557: [xcode] “OBJC_CLASS_GKLocalPlayer", referenced from: 61558: [xcode] objc-class-ref in ISN_GameCenter.o 61559: [xcode] "_OBJC_CLASS__GKPlayer”, referenced from:
61560: [xcode] objc-class-ref in ISN_GameCenter.o
61561: [xcode] “OBJC_CLASS_GKLeaderboard", referenced from: 61562: [xcode] objc-class-ref in ISN_GameCenter.o 61563: [xcode] "_OBJC_CLASS__GKScore”, referenced from:
61564: [xcode] objc-class-ref in ISN_GameCenter.o
61565: [xcode] “OBJC_CLASS_GKMatchmaker", referenced from: 61566: [xcode] objc-class-ref in ISN_GameCenter.o 61567: [xcode] "_OBJC_CLASS__SLRequest”, referenced from:
61568: [xcode] objc-class-ref in ISN_SocialGate.o
61569: [xcode] “OBJC_CLASS_GKGameCenterViewController", referenced from: 61570: [xcode] objc-class-ref in ISN_GameCenter.o 61571: [xcode] "_SLServiceTypeFacebook", referenced from: 61572: [xcode] -[ISN_SocialGate fbPost:url:media:] in ISN_SocialGate.o 61573: [xcode] "_ACAccountTypeIdentifierTwitter", referenced from: 61574: [xcode] -[ISN_SocialGate twitterPostGif:url:] in ISN_SocialGate.o 61575: [xcode] -[IOSTwitterPlugin authificateUser] in ISN_SocialGate.o 61576: [xcode] -[IOSTwitterPlugin loadUserData] in ISN_SocialGate.o 61577: [xcode] -[IOSTwitterPlugin IsTwitterAuthed] in ISN_SocialGate.o 61578: [xcode] "_OBJC_CLASS__MFMailComposeViewController”, referenced from:
61579: [xcode] objc-class-ref in ISN_SocialGate.o
61580: [xcode] “OBJC_CLASS_SLComposeViewController", referenced from: 61581: [xcode] objc-class-ref in ISN_SocialGate.o 61582: [xcode] "_OBJC_CLASS__GKTurnBasedMatchmakerViewController”, referenced from:
61583: [xcode] objc-class-ref in ISN_GameCenter.o
61584: [xcode] “OBJC_CLASS_ACAccountStore", referenced from: 61585: [xcode] objc-class-ref in ISN_SocialGate.o 61586: [xcode] "_OBJC_CLASS__SLComposeServiceViewController”, referenced from:
61587: [xcode] objc-class-ref in ISN_SocialGate.o
61588: [xcode] “OBJC_CLASS_GKMatchRequest", referenced from: 61589: [xcode] objc-class-ref in ISN_GameCenter.o 61590: [xcode] "_OBJC_CLASS__GKMatchmakerViewController”, referenced from:
61591: [xcode] objc-class-ref in ISN_GameCenter.o
61592: [xcode] “OBJC_CLASS$_GKTurnBasedMatch”, referenced from:
61593: [xcode] objc-class-ref in ISN_GameCenter.o
61594: [xcode] “_SLServiceTypeTwitter”, referenced from:
61595: [xcode] -[ISN_SocialGate twitterPost:url:media:] in ISN_SocialGate.o
61596: [xcode] ___37-[ISN_SocialGate twitterPostGif:url:]_block_invoke in ISN_SocialGate.o
61597: [xcode] ___32-[IOSTwitterPlugin loadUserData]_block_invoke in ISN_SocialGate.o
61598: [xcode] -[IOSTwitterPlugin postWithMedia:media:] in ISN_SocialGate.o
61599: [xcode] -[IOSTwitterPlugin post:] in ISN_SocialGate.o
61600: [xcode] -[IOSTwitterPlugin IsTwitterAvaliable] in ISN_SocialGate.o
61601: [xcode] ld: symbol(s) not found for architecture arm64
61602: [xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)
61603: [xcode] ** ARCHIVE FAILED **
61604: [xcode] The following build commands failed:
61605: [xcode] Ld /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-dhpfificbbsfbqdoigvfxtszkhan/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/sword normal arm64
61606: [xcode] (1 failure)
61607: ! build of ‘default-ios’ failed. compile failed
61608: Publishing build 51 of dac-15733/sword01 for target ‘default-ios’…
61609: Uploading extra_data/artifacts/icon.png …done
61610: publishing finished successfully.
61611: uninstalling iOS credentials for dac-15733/sword01 - default-ios
61612: MAC verified OK
61613: Removing certificate…
61614: removing: /BUILD_PATH/Library/MobileDevice/Provisioning Profiles/5d4b1ec5-1211-4e0a-bb77-5671e15536a0.mobileprovision
61615: done.
61616: Build step ‘Execute shell’ marked build as failure
61617: postbuildstatus finished successfully.
61618: Finished: FAILURE

You should add GameKit.framework to your build

Hi liortal,

thanks for the response! The problem here is that previously the build worked without a problem and suddenly it stopped working.

Anyway, how can I add the GameKit Framework to the cloud build?

Thanks!

I am not familiar with the history of your project, so i can’t say why it stopped working.

You have 2 choices i can think of to add this:

  • If you already have iOS plugins in your project (e.g: a .framework file, or any other iOS native code file), you should be able to set it up through this file’s plugin inspector. When you select that file, the inspector will show you different settings for that plugin. In that inspector, you can select additional frameworks that the plugin requires. You can add GameKit (check its checkbox).
  • Another option is to create a custom editor script that uses the Xcode API to modify the built Xcode project to add GameKit. See this thread for info on how to do it (very simple): UCB Demos - Unity Services - Unity Discussions

Hi liortal,

It is working now, for some reason I had to add all frameworks manually to unity cloud build (following your suggestion on step 2)

Thank you SO much! :slight_smile: