Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

ARKit 1.5 backward compatibility with devices that don't have 11.3

Discussion in 'AR' started by lmalave, Feb 22, 2018.

  1. lmalave

    lmalave

    Joined:
    Dec 29, 2014
    Posts:
    5
    I'm successfully building and using ARKit 1.5 apps with the ARKit unity plugin spring 2018 update branch on a device that I've updated to the iOS 11.3 beta. On a device with 11.2, though, the ARKit scene crashes on load.

    How can I make the app backward compatible so iOS 11.2 devices can still use ARKit with the horizontal planes and 11.3 devices can use the vertical planes?
     
  2. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    do you have a callstack when it crashes?
     
  3. lmalave

    lmalave

    Joined:
    Dec 29, 2014
    Posts:
    5
    Don't have a callstack but I was able to find a workaround for what I needed.

    Since I am only interested in vertical planes (and not Image Targets or other ARKit 1.5 features), I was able to fix the issue by modifying the ARSessionNative.mm file. I commented out all the ImageTarget related methods and put in a runtime conditional to check for iOS 11.3. Seems to work fine on my initial tests, I was able to use vertical planes on an 11.3 device but the app still ran fine on an 11.2 device using only horizontal planes.
     
  4. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
  5. ezonecom

    ezonecom

    Joined:
    Jul 23, 2013
    Posts:
    17
    I'm using the 2D image detection, and it's working great:



    but I'm having similar issues trying to maintain compatibility with pre iOS 11.3 devices. In Xcode if I change the deployment target to < 11.3 (e.g. 11.0) I get an Asset Catalog Compiler Error:

    ..../Xcode/Unity-iPhone/Images.xcassets: Exception while running actool: *** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: catalog)


    Looks like this has been logged as a bug with Apple, but I thought I'd mention it here in case anyone else runs into the same issue:

    https://forums.developer.apple.com/thread/96235
     
  6. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Haven't had a chance to try it yet - but have you checked release version of XCode 9.3 if it has same problem?
     
  7. ezonecom

    ezonecom

    Joined:
    Jul 23, 2013
    Posts:
    17
    Hi Jimmy - I just tried it then and get the same error :(
     
  8. ezonecom

    ezonecom

    Joined:
    Jul 23, 2013
    Posts:
    17
  9. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Yes, we found the same issue - Apple are taking a look at it.