Unity ARKit Scene Error Grey Screen NSInvalidArgumentException

I'm trying to run the UnityARKitScene on my device (6s Plus) to develop for ARkit.

I pulled in the Unity ARKit package into the app and did not make any modifications to it. The app builds and installs on my device without issue, but when I run it i just see a grey screen, and the following error in the output logs:


Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ARFrame displayTransformWithViewportSize:orientation:]: unrecognized selector sent to instance 0x1c42ee600'

*** First throw call stack:

(0x185a03d38 0x184f18528 0x185a111f8 0x185a096e4 0x1858ef0dc 0x102fe541c 0x19fe00ff8 0x185389088 0x185389048 0x185395b74 0x1859abf20 0x1859a9afc 0x1858ca2d8 0x187750f84 0x18edfc27c 0x102c6a13c 0x1853ee56c)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb)



What's the issue here, and how might I go about fixing it?

>how might I go about fixing it?


What did unity support recommend?


h ttps://forum.unity3d.com

Hi!


I have the exact same problem.

Seems like displayTransformWithViewportSize:orientation: is deprecated.


So probably the Unity ARKit Plugin has to be adjusted:

https://developer.apple.com/documentation/arkit/arframe?language=objc


Cheers,

Boris

You can change following in the XCode project, after that it is working fine:


(ARSessionNative.mm Line 268)

s_CurAffineTransform = [frame displayTransformWithViewportSize:nativeSize orientation:[[UIApplication sharedApplication] statusBarOrientation]];


to


s_CurAffineTransform = [frame displayTransformForOrientation:[[UIApplication sharedApplication] statusBarOrientation] viewportSize:nativeSize];



and (ARSessionNative.mm Line 151)


[NSException raise:@"UnrecognizedARTrackingStateReason" format:@"Unrecognized ARTrackingStateReason: %ld", (long)trackingReason];


to


//[NSException raise:@"UnrecognizedARTrackingStateReason" format:@"Unrecog…



Cheers,

Boris

Unity ARKit Scene Error Grey Screen NSInvalidArgumentException
 
 
Q