Search Unity

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

    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

    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

    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

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