Search Issue Tracker
By Design
Votes
3
Found in [Package]
1.0.0-preview.18, preview.12
Issue ID
1076647
Regression
No
After creating Assembly Definition file can't reference XR.AR libraries
To reproduce:
1. Create a new project
2. Import AR Foundation package from Package Manager
3. Create a new C# script in any folder
4. Open the script and write "using UnityEngine.XR.ARFoundation;" observe no errors in the console and in the IDE
5. Close IDE and in Unity create new Assembly Definition file in the same folder as the C# script is
6. Observe the console for "error CS0234: The type or namespace name `ARFoundation' does not exist in the namespace `UnityEngine.XR'. Are you missing an assembly reference?" error
Expected result: no errors are thrown in the console
Actual result: can't reference any AR library from packages eg. ARCore, ARKit, ARFoundation
Reproduced on:
2018.1.9f2 2018.2.11f1 2018.3.0b4 2019.1.0a3
Notes:
It happens with ARCore and ARKit also.
MacOS 10.13.6
Also reproduces on Windows 10 machine.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
Resolution Note:
Unity.XR.ARFoundation shows up in the list of assembly definition assets along with all of the built-in, package supplied, and user-created ones. So the solution is to add a reference to it in the inspector UI for the assembly definition file you created (see https://imgur.com/a/WYREZdB). There is no need to drag anything from the Packages folder.
We don't assume that any package delivered by package manager should be implicitly included so developers will need to specify each assembly they are referencing in their own assembly definition files. This may be cumbersome to set up once but doing so helps reduce build times. Read more about this here: https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html