Project upgraded from Google Cardboard to GoogleVR runs in Unity but fails when building for iOS (XCode or Unity Cloud Build)
I started my project using Google Cardboard then I imported the new GoogleVR package to replace it. When I hit play in Unity my project works fine but when I try to build it for iOS I get errors on both the Xcode project and the Unity Cloud build project. I'm using Unity v5.5.0f3 on Mac
Undefined symbols for architecture armv7:
"_endSettingsDialog", referenced from:
-[DismissDialogViewController viewDidAppear:] in libvrunity.a(unity.o)
"_isOpenGLAPI", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've noticed that most of the answers to this kind of problem refer to SourceTree (This is what I'm using) ignoring .dll file when pushing the source code. At the moment I don't have any .gitignore file in my working directory.
Why are there still references to "Assets/Cardboard"? There should only be references to "Assets/GoogleVR" with the new SD$$anonymous$$.
Not sure why, it looks like there are some references. I think I have to check all the game objects
Answer by guneyozsan · Mar 30, 2017 at 01:09 PM
The only way I could get an iOS build was with Unity 5.6.0f2 and Google VR 1.30 by following these steps:
Enable VR Support for iOS in Unity and add Cardboard. Search for UNITY_HAS_GOOGLEVR in the project scripts and modify the code to include IOS with Android as well. Mostly this is putting || UNITY_IOS
next to UNITY_ANDROID
. A few places require some more detailed tweaks but you can figure it out reading the code. You should do this for all Google VR SDK scripts except the ones related with Daydream Controller. What I did was to put it everywhere and clean them back following the console errors after you hit Build in Unity. Also I commented out a few of the lines with errors instead of rolling back UNITY_IOS as some part of the code was still needed in iOS.
Build in Unity.
In iOS Project Builder, add the path "-IPods\GVRSDK\Sources" for the missing file "GVROverlayView.h" as a compiler flag.
Remove the line containing:
/* libPods-Unity-iPhone.a in Frameworks */,
from the project.pbxproj file in the Xcode project, because it was complaining "file not found".
Compile using iOS Project Builder for Windows.
Enable VR Support for iOS in Unity and add Cardboard
Why adding Cardboard?
There are too many errors in Google Cloud build. I will probably focus on building from XCode. The only error I get there is
not sure how to fix itUndefined symbols for architecture arm64: "_endSettingsDialog", referenced from: -[DismissDialogViewController viewDidAppear:] in libvrunity.a(unity.o)
It is a toolbox that let's you compile iOS projects in Windows. I don't have a solution for $$anonymous$$ac.
Answer by Claus79 · Apr 05, 2017 at 09:38 AM
They only way to solve it was by:
Removing GoogleVR plugin (and all references to it) in my project
Replacing the GazeVR view tracking with a simple Raycasting in order to activate specific methods on the game object the user is looking to.
Activating virtual mode in the "Building Setting" when exporting to iOS
Removing libvrunity.a and libgvrunity.a libraries from the XCode project
Assuring the Bitcode support is set to NO
Importing GoogleVR as cocoapod.
Unfortunately this procedure prevents me from displaying the Stereo View in the Unity Editor.
@guneyzsan @alimoeeny Apparently we need to wait for an update. I have already opened an issue on GoogleVR GitHub repository.
Thanks @claus79 didn't know about GoogleVR pod, should look into it. Yes I think we need to wait for 1.40 and see if that is going to solve the problem.
Answer by alimoeeny · Apr 04, 2017 at 06:04 PM
How did they release 5.6 without fixing this?
It is about Google VR SD$$anonymous$$. Current version 1.30 doesn't support native iOS in Unity 5.6. They say it will be fixed in Google VR 1.40.
Thanks @guneyozsan , I am going through all the code and trying to find the correct places to add UNITY_IOS . What I get is if I add cardboard in support vr, I cannot use cocoapods which I need to use. Also still I have not been able to enable the streoview, the Head
on the stereocontroller is null
Sorry I don't use cocoapods so no idea about it.
Here if you scroll below, I uploaded an edited Google SD$$anonymous$$ folder: https://github.com/googlevr/gvr-unity-sdk/issues/504
After Unity 5.6f series you cannot have stereoview on iOS without adding it to the vr settings. They are removing backwards compatibility for non-native versions. If you can't solve the cocoapod issue you may need to wait for Google's update.
Your answer
Follow this Question
Related Questions
The best overloaded method match for google play games 1 Answer
ARCore compatibility with iOS platform 2 Answers
ios app crashes on start 0 Answers
Firebase List Users 1 Answer
Is DateTime working on iOS? 0 Answers