The problem
I'm trying to build google cardboard for unity on my android and getting build errors
- I have unity 2020.3.37f1 with android build support
- I followed the quickstart - https://developers.google.com/cardboard/develop/unity/quickstart
- I have the
HelloCardboardscence in myScences in build - I have my phone plugged in
- I'm getting a gradle error
The error
also I don't know if it's related but when I try to play the HelloCardboard scence, it keeps throwing this error:

What i've tried
- changing the player settings (API, target arch...)
- emulated several phones in android studio
- downloaded JDK and android SDK tools instead of the recommended

The error says you should initialize the XR Loader.
There is a checkbox for "Initialize XR on Startup" in Project Settings, under XR Plug-in Management section. And you have to select the Plug-in Provider, which in this case should be "Cardboard XR Plugin".
You may also initialize the Loader at runtime in the code if you instead want the app to start in 3d. It's all in the documentation.