Skip to main content
Up and Coming
May 13, 2021

Unity Build Won't Build Onto Headset

So, I created a test scene to test controller presence and functionality following a guide I found online. The only problem is, whenever I hit "Build and Run", it doesn't build it onto my headset. I found this out when nothing was working and I tried removing a cube. Sure enough, it was still there. I removed the project and tried to rebuild it. Still nothing. Any ideas? Thanks in advance for any help!

    This topic has been closed for replies.

    10 replies

    Up and Coming
    May 13, 2021

    So I found the errors it was giving me, here they are:

     

    OVRADBTool adb server version (41) doesn't match this client (40); killing...
    * daemon started successfully

    UnityEngine.Debug:LogError (object)
    OVRADBTool:RunCommand (string[],OVRADBTool/WaitingProcessToExitCallback,string&,string&) (at Assets/Oculus/VR/Editor/OVRADBTool.cs:204)
    OVRADBTool:GetDevices () (at Assets/Oculus/VR/Editor/OVRADBTool.cs:114)
    OVRGradleGeneration:OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport) (at Assets/Oculus/VR/Editor/OVRGradleGeneration.cs:376)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

    Error building Player: OVRADBTool adb server version (41) doesn't match this client (40); killing...
    * daemon started successfully


    Build completed with a result of 'Failed' in 120 seconds (119837 ms)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

    UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <0c3742f371b24679bcaa6fcc508d0cca>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <0c3742f371b24679bcaa6fcc508d0cca>:0
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

     

    Up and Coming
    May 14, 2021

    Install Oculus Developer Hub, if it asks to switch ADB , do it and try to build. If that fails switch back and try again.
    I had similar error and this fixed it for me.

    Up and Coming
    May 14, 2021

    Installing Developer Hub didn't do anything, and I was not asked to switch ADB. Am I meant to install it from Developer Hub, or am I missing something?

    Up and Coming
    May 15, 2021

    Do you have this?
    https://developer.oculus.com/downloads/package/oculus-adb-drivers/

    It's looking for a version of ADB you don't have

    Up and Coming
    May 15, 2021

    I didn't have that, but I installed it. After that, it never asked me anything about ADB. I hit Build and Run and it still didn't build onto my headset. I'm stumped.

    May 15, 2021

    Build completed with a result of 'Failed' in 120 seconds (119837 ms)

     

    I don't think the ADB version is the issue. It looks like your build is failing before installation. There's a different message if the installation/copying fails.

     

    The most common reason my builds fail is that I haven't entered the correct password for the keystore/key that's signing the apk. The second most common reason is scripts that depend on UnityEditor functionality are still being compiled for device builds (need to move those scripts into an Editor folder or surround the code with #if UNITY_EDITOR/#endif).

     

    You don't say what version of Unity you are using. If you're using 2019 or higher, make sure you're installing the "Android Build Support" options as well and that in preferences under "External Tools" you're using the android tools installed by Unity.

    Up and Coming
    May 16, 2021

    Where do I install Android Build support and configure it correctly? I may already have it but I'm not completely sure.

    Up and Coming
    May 15, 2021

    I think here is the issue
    Error building Player: OVRADBTool adb server version (41) doesn't match this client (40); killing

    May 15, 2021

    Maybe. I've seen this message in the past, but I don't remember it being fatal.

     

    It looks like the adb version that comes with Unity 2019 and 2020 is 40 and the one that comes with Oculus Developer Hub is 41. 41 is probably also installed with Android Studio too.

     

    I guess a way to test would be opening a command prompt and typing "adb --version". If you see an error message that means there's no adb on your system path, if you do that's probably the adb installation that's interferring with Unity.

     

    The rogue adb installation might also show up in this list inside of the Oculus Developer Hub app. (Click "modify" next to ADB Path in settings). Preferably you would only have the ones installed by Unity and Oculus Developer Hub.

    Up and Coming
    May 16, 2021

    Mine was fixed with the Hub switch but recommend above 100%
    Can't build if adb not connected. Also close ODH when building