Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2019.4.X, 2020.1.X, 2020.2.X

Votes

6

Found in

2019.3.0b10

Issue ID

1196164

Regression

No

Switching targets in SRP projects will cause XR errors on some platforms

Scripting

-

Switching build targets in a project using Scriptable Render Pipelines will create reference errors to 'XRSettings' on platforms that do not support XR.

When working in a project utilising Universal Render Pipeline, if the user adjusts their build target to TVOS, the following blocking errors will appear:

Library/PackageCache/com.unity.render-pipelines.core@7.1.1/Runtime/Common/XRGraphics.cs(94,28): error CS0103: The name 'XRSettings' does not exist in the current context

Switching build targets back to the original target will not correct this issue alone and the user must restart the editor in addition to resetting the target.

Steps to reproduce:
- On an OSX machine, Create a new Unity project using the Universal RP template (found in 2019.3.0b10)
- File > Build Settings > iOS > "Switch Platform"
- Observe there are no errors
- File > Build Settings > tvOS > "Switch Platform"
- Observe the above noted exception now will appear
- File > Build Settings > iOS > "Switch Platform"
- Observe the previous errors remain
- Restart the Unity editor and re-open the project
- Observe the errors no longer appear

Comments (6)

  1. CGCowboy

    Feb 19, 2022 01:51

    Did anyone ever find a solution to this? I just switched my target platform to Xbox and I have this all over the place. I'm on 2019.4.33f1.

  2. Polyfemos

    Dec 20, 2021 21:08

    I'm getting this when switching to TVOS on 2020.3.24

  3. ColtonRamos

    Nov 10, 2020 22:20

    I can verify this is fixed for my particular issues in 2019.4.14f1. Thanks for the quick fix, guys!

  4. ColtonRamos

    Oct 27, 2020 17:46

    I'm seeing this error message and several others like it when switching between Xbox and Standalone build platforms on 2019.4.13f1 LTS.

    It (thankfully) looks like this fix will make it into 2019.4. Thanks guys! Any idea when this fix will be released?

  5. ustincameron

    Aug 26, 2020 19:32

    Does anyone know how to resolve this? Switching to tvOS platform created this error for me and now I'm unable to build for any other platform...

  6. QAG_Alex

    May 20, 2020 16:49

    I'm also seeing this when switching between console platforms (XboxOne, PS4, and Switch).

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.