ETA on IOS Cardboard support for Unity 2017?

I’ve been working on a Cardboard project for a client, and we’ve upgraded to 2017 to utilize it’s new features like Timeline. I’ve been unable to build it to iOS without getting a Mach-O linker error. From what I’ve gathered, this is a known issue, but I was wondering when this will be fixed? Thanks.

Google distributes the Cardboard Native Development Kit (NDK) for iOS through the Cocoapods library management system. Unity is integrated with a specific version of that Cardboard NDK from the Cocoapods manager and uses the NDK to create your XCode project. This means the resulting project is generated differently from a standard Unity project; Cocoapods creates a wrapping XCode workspace that contains the Unity project as well as a project for the Cardboard NDK library and its dependencies. Always make sure that you open and/or use the workspace and not just the project to avoid getting linker errors due to the missing libraries from Cocoapods.

@joejo Thank you for the speedy reply! However, I have been opening the workspace file and am still getting the linker error.

Can you try doing a Build & Run in Unity and select Replace, or maybe create a new Xcode project to test?

@joejo Just tried Build & Run, enabling Replace, and creating a new Xcode project to test, still getting the inexplicable linker error. EDIT: Btw, just so you know, the game itself does work, for example I can run it on Oculus no problem. Thanks!

What is the exact linker error you are getting and what build of 2017.1?

@joejo “Linker command failed with exit code 1” and the Build is the latest b8 build

But what did it fail to link? I assume that the build log has a little more info on what failed to link exactly. If not then this issue is not the same as what has been reported as all those where failures to link against the Pods stuff.

@joejo This any help? Imgur: The magic of the Internet

Duplicate symbols, most likely because you are using an older version of the GoogleVR SDK for Unity that had that bad iOS library in it. That’s my best guess given the picture. You’ll need to upgrade your GoogleVR SDK for Unity package to at least 1.4. You might want to completely delete the GoogleVR package from your Unity project, re-import it and then recreate your project.

@joejo I’ve just updated the GoogleVR package straight from the website, version 1.60, and I’m still getting the exact same error log. Thanks so much for the support btw, not quite sure what the issue with my project is.

I have no idea. If you could provide a repo project and post a link here I can take a look but other than that I am out of ideas here.

@joej Thank you for all the support, I went ahead and did a test build with a clean project and it seemed to compile fine. I guess something got messed up with the Google VR part of my project. I’ll have to debug that on my own. Thank you again for all the help!

I suspect you haven’t updated the pods to 1.60. (Google VR SDK unity package != Google VR SDK pods)
Open the cocoapods app, open the pods file (or drag it in)
Change the version to (~> 1.60)
select update at the right top
then install

then try building with the xcode workspace again

should work

I am afraid I made an assumption that is totally incorrect on my last recommendation. The one thing that many people don’t realize is that, when they install the Google VR SDK for Unity, not only does it create a GoogleVR folder but it ALSO creates or populates a Plugins folder. The contents of the Plugins folder is where all the native shares libraries are that are being linked into your Xcode project. That means that if you just deleted the GoogleVR folder and not the stuff in Plugins that GoogleVR added, reimporting may not have done anything for you.

If you didn’t do this already, I would remove anything with the word “gvr” in it from the Plugins/iOS folder at a minimum if not all the gvr related bits under Plugins just to make sure re-import is as clean as possible.

1 Like

@joejo That did the trick! Yes, I did not think to remove the GVR files in the Plugins folder as well. Thank you so much! You’ve saved me a lot of time and effort.