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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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