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
- [Mobile] Developer Console does not appear when an error is thrown
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
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