iosunity-game-enginegoogle-cardboardgoogle-vrgoogle-vr-sdk

Project upgraded from Google Cardboard to Google VR 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.

On Xcode:

ld: warning: arm64 function not 4-byte aligned: ltmp0 from /Users/gamedev/Desktop/VR1-iOS/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
 ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/gamedev/Desktop/VR1-iOS/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
 Undefined symbols for architecture arm64:
   "_endSettingsDialog", referenced from:
       -[DismissDialogViewController viewDidAppear:] in libvrunity.a(unity.o)
 ld: symbol(s) not found for architecture arm64
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

on Unity cloud build:

[xcode] Undefined symbols for architecture armv7:
 9352:        [xcode]   "_endSettingsDialog", referenced from:
 9353:        [xcode]       -[DismissDialogViewController viewDidAppear:] in libvrunity.a(unity.o)
 9354:        [xcode]   "_isOpenGLAPI", referenced from:
 9355:        [xcode]       RegisterMonoModules() in RegisterMonoModules.o
 9356:        [xcode] ld: symbol(s) not found for architecture armv7
 9357:        [xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)
 9358:        [xcode] Showing first 200 warnings only
 9359:        [xcode] ** ARCHIVE FAILED **
 9360:        [xcode] The following build commands failed:
 9361:        [xcode]     Ld /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-gccgnjkpqhormzcosgksevxlzeea/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/APPLICATION_PATH/vr1.app/vr1 normal armv7
 9362:        [xcode] (1 failure)

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.

UPDATE I have upgraded to Unity 5.6 and the errors changed a bit:

"_endSettingsDialog", referenced from:
-[DismissDialogViewController viewDidAppear:] in libvrunity.a(unity.o)

Undefined symbols for architecture arm64:
  "_isOpenGLAPI", referenced from:
      _iOSDevice_isOpenGLAPI_m3529398287 in Bulk_Assembly-CSharp_0.o
     (maybe you meant: _iOSDevice_isOpenGLAPI_m3529398287)
ld: symbol(s) not found for architecture arm64

when checking between the libraries linked (in Build Settings) I noticed I had both libvrunity.a and libgvrunity.a so I removed the first one and the error is disappeared, but I still have the second about OpenGL. The strange thing is that the project work flawlessly in unity.


Solution

  • Apparently it is all about Google VR SDK. Current version 1.30 doesn't support native iOS in Unity 5.6.

    They only way to solve it was:

    Unfortunately this procedure prevents me from displaying the Stereo View in the Unity Editor.

    We need to wait for the 1.40 update. I have already opened an issue on GoogleVR GitHub repository.