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
- Selector gets stuck in UI if scroll is used while dragging
- Created asset is placed in a new folder when creating a new folder and instantly creating an asset by clicking somewhere else
- Selecting and deleting transition in Animator does not add to Undo History when animation is previewed in Inspector
- GameObjects remain static when updating constraints of PhysicsJoint with "Enable Sleeping" selected in Havok Physics Configuration
- [iOS] Touch input is not clocked and UI is unresponsive when the application is paused mid-drag without lifting the finger
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