Search code examples
unity-game-enginehololenswindows-mixed-realitymrtk

Cannot deploy to HoloLens (error 80004005)


I have freshly installed Unity 2018.3.10 with Visual Studio 2017 (15.9.10). I cannot deploy a bare-bones 3D unity application to HoloLens due to an error in Visual Studio ("DEP0100: Please ensure that target device has developer mode enabled. Could not obtain a developer license on 127.0.0.1 due to error 80004005"). Here are the steps to reproduce:

  • Create new 3D scene in Unity. Set camera position to 0,0,0 and camera clear color to solid black. Create a red cube in front of the camera with dimensions 0.1x0.1x0.1

  • Window / Package Manager : remove Ads, Analytics Library, In App Purchasing, TextMesh Pro, Unity Collaborate, because I don't need these

  • Build settings and Project Settings (Quality and Player Settings) shown in screenshots. Scripting backend = IL2CPP

screenshots

  • Unity successfully generates a .sln file
  • The HoloLens has OS build 10.0.17763.316 . Under Settings/Update & Security / For developers , I set 'Use developer features'=on, 'Enable Device Portal'=on

  • I don't know if it's necessary, but on my PC, I also do Settings/Update & Security/For developers, select 'Developer mode', 'Enable Device Portal'=on, 'Device discovery'=on

  • Connect HoloLens to PC via USB cable
  • Open the .sln file in Visual Studio. Set to Release, x86, Device. Build / Deploy Solution
  • Compilation is successful, and Visual Studio asks for a PIN, which I get from the HoloLens by opening Settings / Update & Security / For developers / Device Discover / Pair
  • Visual Studio shows error message: DEP0100: Please ensure that target device has developer mode enabled. Could not obtain a developer license on 127.0.0.1 due to error 80004005

Solution

    1. Make sure Developer mode is enabled on the Hololens. You can find this in settings.

    If that doesn't work then...

    1. Try reseting the device.

    Reseting is annoying but that is the solution found for 'Could not obtain a developer license on 127.0.0.1 due to error 80004005'on the forums: https://forums.hololens.com/discussion/8964/could-not-obtain-developer-license-for-hololens

    Pasting the comment here as those forums will be removed:

    "shyykoserhiy ✭ November 2017 I've had the same issue. Tried to run from two different setups: MacBook Pro 2016 with touch bar (windows 10 Pro in Bootcamp) and Surface Pro 4. Same error on two different machines. So I've though that it might be a problem with the HoloLens itself. After Resetting the HoloLens from Settings> Update and Security> Reset everything started to work just fine. This is the only solution that've worked for me."

    It is also mentioned in the unity forums: https://forum.unity.com/threads/could-not-obtain-developer-license-for-hololens.500808/

    "billyjacobs So I did some searching and found that one way to solve the problem is to reset your hololens device. It will have the latest version of the device software after you reset it. I was hesitant against doing this at first but it worked like a charm."