Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

OnPreprocessBuild throws an error if the SDK is even present in a project #954

Closed
andybak opened this issue Aug 24, 2018 · 6 comments
Closed

Comments

@andybak
Copy link

andybak commented Aug 24, 2018

Summary:

I have a project that needs to build for several platforms. Some platforms require Unity's XR Supported checkbox to be off. (The same issue would occur for projects that are intended for both VR and non-VR builds). As soon as I add the GVR SDK the builds for other platforms fail with the error: "To use the Google VR SDK on Android, 'Player Settings > Virtual Reality Supported' setting must be checked.
Please fix this setting and rebuild your app." (there are other errors along the same lines)

Why does the GVR SDK assume that adding it to a project means that project will only ever be used for Google VR builds?

Found using:

  • Google VR SDK version: 1.150.0
  • Unity version: 2018.2.4f1
  • Phone manufacturer, model, and O/S version: n/a
  • Viewer manufacturer & model: n/a

Steps to reproduce the issue:

  1. Start a new project
  2. Add Google VR Unity SDK package to the project
  3. Attempt to build an empty scene. The build fails and errors is displayed.

Workarounds:

  1. Add/remove the entire Google VR SDK every time I want to build for a each platform (takes several minutes and means I can't have an automated build pipeline)
  2. Disable the check every time I update the GVR SDK

Additional comments:

Suggested resolution...

  1. Change the error to a warning
  2. Only throw an error if the build contains a scene with a Google VR component in it.
  3. Remove it entirely and assume the user knows what they are doing
@fredsa
Copy link
Contributor

fredsa commented Aug 24, 2018

Thanks, @andybak.

The error messages in GvrBuildProcessor where added to help developers, especially those getting started with Google VR SDK for the first time, avoid common project configuration pitfalls.

Would be helpful if we wrapped that code in conditional compilation?, like so:

#if !GVR_SKIP_BUILD_PREPROCESS_CHECKS
  Debug.LogError("…");
#endif

This would allow you and other experienced developers suppress the SDK checks by adding the symbol to Player Settings > Scripting Define Symbols.

@andybak
Copy link
Author

andybak commented Aug 27, 2018

You've got it backwards.

Experienced developers will easily get round this problem.

Less experienced developers who are trying to do something fairly reasonable (like build an app for one than one platform) will get totally stuck.

So your "solution" helps a very small slice of your target demographic.

@fredsa
Copy link
Contributor

fredsa commented Aug 27, 2018

Would you prefer LogError -> LogWarning?

@andybak
Copy link
Author

andybak commented Aug 28, 2018

I think that would probably improve things.

  1. Inexperienced user should learn to check the warnings log in any case. A gentle nudge is never a bad thing.
  2. For more experienced users - it fits the role of a warning perfectly - something you most probably don't want to be doing but where there are exceptional cases that make it a perfectly valid action.

@fredsa
Copy link
Contributor

fredsa commented Aug 28, 2018

Sounds good. Will change to logWarning.

@rusmaxham rusmaxham added the bug label Oct 4, 2018
@rusmaxham
Copy link
Contributor

Fixed in the latest release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants