Unity 5.6.0b10 iOS GVR Native Linker error

Hello,

I’ve imported the GVR SDK v1.30 from google’s SDK download page.
I’ve also included the Cardboard in the Virtual Reality Support in the player settings to enable Native GVR.

Though, without GVR SDK v1.30 and only the Virtual Reality support in player settings I get no pointers nor UI support.

With the SDK 1.30 included in the project and Virtual Reality support turned on it works fine on Android but not on iOS as it gives a linker error with duplicate symbols.

Without the Virtual Reality Support, both Android and iOS don’t even move using the SDK 1.30

Kind of confused what to do with it now, as Android works using both project and native implementation
and iOS is just nagging about duplicate symbols (as my guess is that the native support is clashing with the project one)

anyone that has more information on how to build a successful build as there is almost / no documentation as usual about 5.6’s native integration and how to use it.

The version of the NDK that is in the current betas is 1.10 and I am not surprised there is a linker issue as the Google distribution of 1.10 had issues with that we where unaware of at the time of integration. We are working on getting 1.20 integrated for release as best we can that should alleviate that issue.

One thing you can do is manually update the generated XCode project to use the newer distribution from Google. Google distributes the iOS Cardboard integration using the Cocoapods package manager (http://cocoapods.org). If you install that and then update the Podfile located in the project folder from this:

pod 'GVRSDK/NDK', '1.10'

to

pod 'GVRSDK', '1.20'

(Or whatever the newer version may be) that should take care of the linker issue you are seeing. NOTE: Since this is an autogenerated project, there is the potential for this to be overwritten if you regenerate the project from Unity. If you go this route you may need to re-apply this solution. Also, we currently have only tested with 1.20 so anything newer may or may not work. YMMV.

I’ll see if Google can also respond to this to see if there are any other suggestions on their end in regards to their SDK and it’s usage with the betas.

I’ve tried your solution, but this does not seem to work.
What I did was open the pod file in the project
changed “pod ‘GVRSDK/NDK’” to “pod ‘GVRSDK’, ‘1.30’”
It is partially solved though, I’ve first seen it for ARM7 but now it is duplicate symbols for ARM64

2985554--222160--Linker Error GVR 1.3.png

I should have mentioned that I you should backup your project just in case. So please, make sure you do that before continuing.

Now, can you try and to delete the Pods folder from the project folder and run pods install?

Note that this may or may not work. We’ve seen issues with trying to upgrade the 1.10 pods libraries shipped through Cocoapods that we integrated originally.

I do apologize for the inconvenience this is causing.

Well we zip our iOS builds from a windows PC and transfer it to a Mac, so always can delete the built project and unzip it again.

I’ve deleted the Pods folder and ran cocoapods → opened the project and clicked install.
it said it was done but after that going back to xcode to build the project again it nagged about the .lock files not being present.
Though I have confirmed that the pod lock file is there, nothing wrong with it.
Is there a step i’ve missed doing?

podfile.lock is in the root directory of the xcode project
the Manifest.lock is in the pods folder
So they are there, though still receiving this error.

2988308--222394--lock file missing.png

Remove the pods folder and the lock files entirely and try again, making sure that you remove everything Pod related but the Podfile. That should make it look like this is a new Pod installation and Pods should add the necessary lock files for you.

Please note that I am unsure you’ll get much farther with this due to an issue with the version of the Google libraries currently integrated into Unity. We haven’t seen issues with the 1.20 integration we are working on internally (and hope to get out soon) but we have seen issues when trying to update the 1.10 integration to 1.20 or later as you are doing here.

After talking with Google recently, there appears to be an issue when using the 1.10 libraries integrated in Unity and the Google VR SDK for Unity. The libraries shipped in the SDK and the library integrated in Unity have duplicate symbols and right now there is no clean way to clean this up. For now, you might be better served to disable VR on your iOS target and use the Cardboard support provided by the Google SDK for Unity. We are working with Google to resolve this issue ASAP.

A note was added to the RC release notes concerning this, and will be posted on the release page when that goes out.

1 Like