Search Unity

Unity 5.6.0f3 + Google Cardboard iOS xcode linker errors

Discussion in 'AR/VR (XR) Discussion' started by antifuzz, Apr 5, 2017.

  1. antifuzz

    antifuzz

    Joined:
    Feb 22, 2013
    Posts:
    99
    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?
     
  2. polygoncgi

    polygoncgi

    Joined:
    Jul 25, 2015
    Posts:
    4
    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.
     
  3. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    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.
     
  4. antifuzz

    antifuzz

    Joined:
    Feb 22, 2013
    Posts:
    99
    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?
     
  5. antifuzz

    antifuzz

    Joined:
    Feb 22, 2013
    Posts:
    99
  6. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    I think you have to grab an updated 1.40 version of the Unity package.
     
  7. mira_leung

    mira_leung

    Official Google Employee

    Joined:
    May 17, 2016
    Posts:
    70
    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.
     
  8. fpilote

    fpilote

    Joined:
    Jul 19, 2013
    Posts:
    5
    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,
     
  9. uchodhry

    uchodhry

    Joined:
    Nov 22, 2012
    Posts:
    7
    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,
     
    ManjitSBedi likes this.
  10. casey945

    casey945

    Joined:
    Feb 16, 2009
    Posts:
    46
    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.
     
  11. polygoncgi

    polygoncgi

    Joined:
    Jul 25, 2015
    Posts:
    4
    I tried opening xcworkspace instead of the xcodeproj as mentioned by fpilote which enabled me to to a build also.
     
    d3garcia likes this.
  12. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    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!
     
    ManjitSBedi likes this.
  13. borderlineinteractive

    borderlineinteractive

    Joined:
    Sep 20, 2015
    Posts:
    14
    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?
     
  14. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    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 :)
     
  15. borderlineinteractive

    borderlineinteractive

    Joined:
    Sep 20, 2015
    Posts:
    14
    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.
     
  16. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    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
     
  17. borderlineinteractive

    borderlineinteractive

    Joined:
    Sep 20, 2015
    Posts:
    14
    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.