Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
PeytonCrafty1's avatar
4 years ago

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!

10 Replies

Replies have been turned off for this discussion
  • 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 ()

     

  • 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.

  • 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?

  • 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.

    • Anonymous's avatar
      Anonymous

      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.

      • PeytonCrafty1's avatar
        PeytonCrafty1
        Explorer

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

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

  • Anonymous's avatar
    Anonymous

    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.

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