Posting a FAQ in the hopes that people do not repost the same questions over and over again. Please look through this, and if possible, through the forums before you ask your questions!
Unity ARKit Plugin FAQ
Q: What is the Unity ARkit Plugin?
A: Unity ARKit plugin will provide developers with friendly access to ARKit features like world-tracking, live video rendering, plane estimation and updates, hit-testing API, ambient light estimation, and raw point cloud data.
All the features exposed by the ARKit are available from the C# scripting API within Unity. There are also Unity Components for easy integration of these features with existing Unity game projects. Please see the README.md file in the bitbucket repository for more info.
Please join us at ARKit support for iOS via Unity-ARKit-Plugin - Unity Engine - Unity Discussions to get started.
Q: What are the prerequisites for making the Unity ARKit Plugin work?
A: This is an experimental preview plugin and it works with beta software, and it should not be used in its current form for production use. It requires the following:
-
iOS 11 latest version
-
XCode 9.4+ with latest iOS SDK that contains ARKit Framework
-
Unity version 2017.1.0 or later
-
iOS device that supports ARKit (iPhone 6S or later, iPad (2017) or later)
Q: Where can I get the Unity ARKit Plugin from?
A: Unity ARKit Plugin (experimental) and its example projects are released as open-source in the bitbucket repository https://bitbucket.org/Unity-Technologies/unity-arkit-plugin . It is also updated on the asset store: Unity Asset Store - The Best Assets for Game Making
Q: Is there any Step-by-Step Tutorial written to create ARKit Project for Unity (from scratch) yet so we can quickly grasp basic concepts?
A: You could start with TUTORIAL.txt that is in the bitbucket.org repo and follow the links there.
Q: Is there a description of the various examples included with the Unity ARKit Plugin?
A: See SCENES.txt included with the plugin distribution.
Q: I’m trying to get the included project to load, but I get compile errors like these: “Assets/Plugins/iOS/UnityARKit/UnityARVideo.cs(59,31): error CS0117: UnityEngine.TextureFormat' does not contain a definition for
R8’
Assets/Plugins/iOS/UnityARKit/UnityARVideo.cs(66,31): error CS0117: UnityEngine.TextureFormat' does not contain a definition for
RG16’”
What have I done wrong?
A: You need to upgrade your Unity version. The minimum Unity versions are:
Unty 5 - version 5.6.2 or newer.
Unity 2017 - version 2017.1.0f3 or newer
Q: When running, I get this error message in XCode console:
“2017-06-05 17:22:43.726156-0700 ProductName[757:217524] [Session] Unable to run the session, configuration is not supported on this device: <ARWorldTrackingSessionConfiguration: 0x1c429b7b0 planeDetection=Horizontal worldAlignment=Gravity lightEstimation=Enabled>
2017-06-05 17:22:43.788207-0700 ProductName[757:217524] AR FAIL”
What is wrong?
A: Your device must have a minimum of an A9 processor (so iPhone 6s and later, iPad (2017) or later). If in doubt, check your processor in this table
Q: But the documentation says that there is a lower level of AR (3DOF) that should work for devices older than iPhone 6S. But it doesn’t work when I try it?
A: There was a little note on iOS 11 beta release notes: “ARSessionConfiguration is only supported on iOS devices with an A9 or later processor and will be enabled for all iOS 11 devices in a future beta.”
Q: Cannot see the content of assets folder in project inspector. It seems that unity cannot read assets folder and library folder. How to solve it?
A: You may have upgraded to macOS 10.13 and chosen to use the APFS filesystem. There is currently an incompatibility between Unity and APFS filesystem. Please check this link for updates.
Q: Will there also be support for the new Vision framework in iOS 11? How about CoreML?
A: This plugin exposes only the ARKit functionality that is currently available.
Q: If I want to use front facing Camera, for tracking is it possible to do that using the ARKit?
A: This is a question for Apple, but the answer currently is that ARKit only works with rear facing camera.
Q: How do I record a video of my awesome ARKit app?
A: iOS 11 has functionality to record video of your screen. See this link.
Q: Can I use Unity ARKit plugin with Unity Vuforia support?
A: Currently, not simultaneously. Both of them require exclusive use of the camera that is on the device, so when one is active, the other cannot be.
Q: I get a linker error like “Geo::GetiOSAppDocumentsDir()”, referenced from:” . How can I fix it?
A: If you see this, make sure the Build Setting in Xcode for Dead Code Stripping is set to Yes
Q: I have an app that I want to support ARKit with, but I also want to support devices that do not have ARKit support. How do I do that?
A: Create an ARKitWorldTackingSessionConfiguration just as you would normally, but before using it to RunWithConfig, query IsSupported on that struct. Then you could decide on a path through your game based on the result of that query.
Q: I have created a gameobject in the scene, but it seems to move with the device camera movement. I cannot seem to get any closer to it.
A: This could be because you created it really far away and with a large scale, and it is really moving closer to you, but you don’t notice it due to perspective. It could also be that you have started ARKit with 3DOF, which will allow you to rotate, but not move in the world.
Q: I got the plugin, and when I export it to my iOS device, it gives me a blank screen with “Waiting for connection…” on it.
A: Go to your Build Settings and specify the “UnityARKitScene” as the scene to export.
Q: The resolution of the video image I get on my app seems lower than that produced by the camera app on the same device?
A: That is correct, ARKit uses a lower resolution camera feed that we upscale to fit your screen. It’s possible they do this to speed up all the processing needed for AR.
Q: I’m trying to get the Unity ARKit Remote to work, but it doesn’t succeed in connecting Editor to Remote with messages like “Failed to connect”?
A: Read and follow the instructions carefully. The most common issue is forgetting to make the Remote app use “Development Build” in step 2 of the instructions. Another common problem is people don’t realize they need to only build one scene to device: UnityARKitRemote.scene, then the rest of the scenes they can play from editor.
Q: I got the plugin, and I have the correct scene, but when I build and run on my device, it gives me a blue screen.
A: This could happen if you have a device that is not supported (e.g not A9 or better cpu), or your provisioning profile or signing credentials are not setup correctly in XCode. See the XCode console log for clues on what it might be.
Q: Can I use the Stimulator when I build in XCode or I have to connect with a real iphone with iOS11?
A: Simulator does not support ARKit at this time - please use a real device.
Q: When I use an iPhone X, there are sections of the screen on bottom and top with messed up video showing - how do I fix it?
A: This was a bug that was fixed in the plugin Oct 3, 2017. Please get version 1.0.10 or later of the plugin. Version 1.0.10 can be downloaded as a zip from https://bitbucket.org/Unity-Technologies/unity-arkit-plugin/get/1.0.10.zip
Q: When I try to run my ARKit app it crashes with the following log message "This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data." What’s the problem?
You have probably changed the ProjectSettings asset distributed with the plugin and removed the PlayerSettings field for “Camera Usage Description” for the build. You need to put in some string in this field for ARKit to work.
Q: When using ARKit Face Tracking, my app crashes right at the beginning with "Terminating with uncaught exception of type Il2CppExceptionWrapper" . What could be the problem?
This usually happens if you have not enabled FaceTracking in the settings and you try to run a face tracking configuration.
Q: I have read everything above, but this plugin is not working as expected. What should I do?
A: Most issues have been solved already and there are hundreds of developers using this plugin to develop apps, so more than likely, your problem is one of the ones in this FAQ, or someone has posted on the forums about it already. If you think you have a legitimate new issue and want to post a question about it, please include the following information:
Xcode logs attached in a txt file (not screenshots of Xcode)
Name of Scene built with unity
Device info (iPhone 7, iPad Pro gen 2, etc.)
iOS beta version
Xcode beta version
Plugin version and whether from bitbucket or asset store