Unity 5.6.0f3 + Google Cardboard iOS xcode linker errors

Trying a totally blank project iOS Unity project with Unity 5.6.0f3 with Virtual Reality Supported checked and the Cardboard SDK added, but when running it from xcode 8.3, I get “apple mach-o linker (id) error”.

There is literally nothing else in the project other than a single cube in the scene.

Any ideas? Am I missing something here or is this a bug?

I’m getting exactly the same problem.

This only happens when you check virtual reality supported.

If you uncheck and import the Google Cardboard SDK package manually you don’t get the error in xCode but when you run on iOS the screen display is not set to VR view and just displays the standard single screen view.

There is a known issue with the current Google VR SDK in that the library they ship to handle audio includes all of the Cardboard NDK as well. This should be resolved when they roll out the 1.40 update of the Google VR SDK on Cocoapods.

Thanks Joejo, but I’m confused… are you saying that we need to wait for Unity to release a patch for 5.6?

I see 1.40 of the Google SDK is available on cocoapods (https://cocoapods.org/pods/GVRSDK), but when I change the podfile in my xcode project to use 1.40 and update it, I still get the same linker error.

Is there any way of working around this now and getting a working iOS build?

Bug report here if anyone else fancies voting on it:

I think you have to grab an updated 1.40 version of the Unity package.

The 1.40 version of the GVR Unity SDK will resolve this issue, and we’ll include steps on updating the generated Cocoapod in the README. Please note that you’ll have to enable Cardboard in Virtual Reality Supported for this to work properly.

We recommend upgrading to Unity 5.6 when 1.40 comes out, since we will no longer support lower versions of Unity as of 1.50.

i had some linking issue like antifuzz. using pretty much the same configuration (unity5.6.0f3, xcode 8.3)

The only difference is that i don’t manually add the google cardboard sdk. I only enable virtual reality support and add Cardboard.

I finally found out that i had to open the xcworkspace instead of the xcodeproj. Using the xcworkspace, there is a “Pods” that is added and compiled before the unity project.

Hope this helps,

Thanks mira leung,

Any info on when version 1.40 for GVR unity will be released? and can you please share a link for that.

Thanks again,

1 Like

i’m getting the same problem.i want to know when version 1.40 for GVR unity will be released?Our team is developing cardboard App.

I tried opening xcworkspace instead of the xcodeproj as mentioned by fpilote which enabled me to to a build also.

1 Like

Gvr SDK 1.40 is out today, i’ve just built both Android and iOS successfully.
Should indeed open the xcworkspace instead of xcodeproj as most are used to.
Should’ve been mentioned somewhere, but it works on iOS! finally!

1 Like

I just got the new Gvr SDK 1.40 and opened the xcworkspace file in Xcode. However, I still get the “apple mach-o linker (id) error”. Do I have to do something specifically to build the “Pods” project before the main project?

You’ve got to update the pods to 1.40 as well.
Unity’s native implementation copies a pods of Google VR SDK 1.20? i believe.
(close xcode if you haven’t already)
Open the pods file (should be in the root of the project) in cocoapods, change ‘~> 1.20’ to ‘~> 1.40’
and put it to update
try building it again in the xcworkspace, should work

if not then delete the pods folder (not the file), delete the pods lock file
then use the pods file again to install the pods (so instead of updating it will install the pods getting a fresh copy)
I hope that helps you :slight_smile:

Thanks for the help. Unfortunately, although the update of the pods file to 1.40 seemd to work I still get the “apple mach-o linker (id) error”. I also followed the step-by-step instructions given in the GitHub repository:

Pod update to the latest GVR iOS SDK
As of Unity 5.6.0f3, the generated Cocoapod can be updated to the latest GVR iOS SDK by following these steps.

  • Build an XCode project from Unity.

  • In a terminal, change directories into the XCode project folder.

  • Run the following commands

  • pod deintegrate

  • pod cache clean --all

  • Change the number in the Podfile from 1.20 to 1.40

  • Open the project in XCode, and delete the Pods directory and Pods.xcodeproj if they exist.

  • In the XCode project settings, change the deployment target to 8.0.

  • Quit XCode

  • In Terminal, do pod update

  • “Installing GVRSDK (1.40.0)” should appear in the console.

  • pod install

This also did not work and I got the same error.

Well what is in the linker error then?
Could you open that and reply with the info?
Might be you didn’t get the import popup for iOS maybe, something to do with the audio it doesn’t ask straight away when importing GVR 1.40 sdk

Might want to try re-importing GVR 1.40 or the project as a whole

I tried to get more information on the bug by adding the -v flag to the Linker settings, but I still get the same error message. At least to me it is not very helpful. Its a list of 1456 duplicate symbols and it is unclear to me if that is only a warning. The log ends with:


ld: 1456 duplicate symbols for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I feel that this is eating away way too much time and I therefore prefer to go back to a stable configuration that does not use native GoogleVR and I will then try to switch once Unity and/or GoogleVR are updated to fix those bugs.

Thank you very much for your help.