Search Unity

Trouble with Arcore on iOS

Discussion in 'AR' started by codedotart, Apr 22, 2020.

  1. codedotart

    codedotart

    Joined:
    Sep 19, 2015
    Posts:
    13
    Hi,

    Few weeks back we made an android app with Arcore. Now we want to port the same over to iOS. I knew that arcore is supported on iOS so I changed the target platform and followed this guide from google to build for iOS.
    https://developers.google.com/ar/develop/unity/quickstart-ios

    The first red signal came when I went to the bitbucket arkit plugin repo and it said that it basically depreciated now. I still downloaded the project and copied the UnityARKitPlugin folder to the assets folder of my project as instructed by the quickstart guide linked above. The unity built went ahead without a hitch but I try to build on Xcode I am seeing errors regarding arkit.



    Undefined symbol: _ArSession_resolveAndAcquireNewCloudAnchor
    Undefined symbol: _ArSession_create
    Undefined symbol: _ArSession_hostAndAcquireNewCloudAnchor
    Undefined symbol: _ArFrame_release
    Undefined symbol: _ArFrame_getTimestamp
    Undefined symbol: _ArPose_destroy
    Undefined symbol: _ARKitAnchor_create
    Undefined symbol: _ArPose_getPoseRaw
    Undefined symbol: _ARKitAnchor_release
    Undefined symbol: _ArAnchorList_acquireItem
    Undefined symbol: _ArSession_reportEngineType
    Undefined symbol: _ArAnchor_getTrackingState
    Undefined symbol: _ArAnchor_detach
    Undefined symbol: _ArAnchor_acquireCloudAnchorId
    Undefined symbol: _ArString_release
    Undefined symbol: _ArAnchorList_destroy
    Undefined symbol: _ArAnchorList_create
    Undefined symbol: _ArAnchor_getCloudAnchorState
    Undefined symbol: _ArSession_destroy
    Undefined symbol: _ArSession_updateAndAcquireArFrame
    Undefined symbol: _ArPose_create
    Undefined symbol: _ArAnchorList_getSize
    Undefined symbol: _ArAnchor_getPose
    Undefined symbol: _ArAnchor_release



    Now I am not able to wrap my head around it as I seem to have followed all the steps mentioned in the quickstart guide. I even checked if there was something i needed to do after adding the arkit plugin nut didn't get any. Can anyone help me with this. I seem to be missing some vital piece somewhere

    Unity: 2018.4.14f1
    Arcore plugin 1.14
     
  2. sam598

    sam598

    Joined:
    Sep 21, 2014
    Posts:
    60
    When making a handheld AR game with Unity there are three paths you can take.

    AR Foundation - This is an API created by Unity that abstracts the common features of ARKit and ARCore, and uses the appropriate one as the backend depending on what target platform you are building. Essentially this lets you code once and easily deploy to either.

    ARCore Unity SDK - This is an SDK created and maintained by Google. Sometimes you can get newer ARCore features a few weeks before they show up in AR Foundation, but Unity regularly updates AR Foundation.

    Unity ARKit Plugin - This is an open source plugin that Unity created in the early days of ARKit. It was great because the native code was open source and could be easily modified. However Unity usually updates AR Foundation within a few weeks of new features being released.

    If you are making a cross platform AR game in Unity I would highly recommend that you use AR Foundation. It is well maintained, in my opinion easier to work than the other plugins, and includes all of the features that 95% of AR developers need.

    To answer your initial question, when Google says that ARCore is supported on iOS that is a bit misleading. ARCore does not do camera tracking or plane detection in iOS devices. All Google really means is that their CloudAnchors API can run on top of ARKit. From the quickstart page you linked you can see that only the CloudAnchors scene is supported. If your app happens to use Google's proprietary CloudAnchors API, in AR Foundation you can access it, and it should work on both Android and iOS.

    Unfortunately you already built your game using Google's ARCore SDK there is not an easy path to convert it to iOS. If you have the resources I would recommend porting your game to AR Foundation since you won't have to maintain two code bases moving forward.
     
    codedotart likes this.
  3. codedotart

    codedotart

    Joined:
    Sep 19, 2015
    Posts:
    13
    Thanks for the answer. Yes I think converting the app to ar foundation seems to be the right way to go. And I should read documentation more carefully in future :)
     
    matanlju likes this.