Error “Unable to start ADB server” when building Unity Android Project

Today I was trying to create a new Unity Android Build for one of my Games, and I faced this error :

CommandWithNoStdoutInvokationFailure: Unable to start ADB server. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
  at UnityEditor.Android.Command.RunWithShellExecute (System.String command, System.String args, System.String workingdir, System.String errorMsg) [0x00060] in <59b231ad19bf42f6b72bf2546a9b9393>:0 
  at UnityEditor.Android.ADB.StartServer () [0x00013] in <59b231ad19bf42f6b72bf2546a9b9393>:0 
  at UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x0000b] in <59b231ad19bf42f6b72bf2546a9b9393>:0 
  at UnityEditor.Android.AndroidDeploymentTargetsExtension.GetKnownTargets (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.ProgressHandler progressHandler) [0x0001d] in <59b231ad19bf42f6b72bf2546a9b9393>:0 
  at UnityEditor.DeploymentTargets.DeploymentTargetManager.GetKnownTargets () [0x00001] in <4dfeb7acf9f44dd0adc2a4f68156471c>:0 
  at UnityEditor.Android.AndroidBuildWindowExtension+<>c__DisplayClass31_0.b__0 () [0x00002] in <59b231ad19bf42f6b72bf2546a9b9393>:0 

After restarting Unity some times, Plugging in and out my Android Device and some research on the Internet, I was finally able to Solve the problem.

What was causing it was a conflict between the ADB.exe from Xamarin for Visual Studio and the ADB.exe from Unity itself. When trying to create the Unity Build, at the same time, I had another instance of Visual Studio Open with an Xamarin Project.

I just closed the Visual Studio Xamarin Project and then IT WORKED! I was able to generate the Android Build for Unity again! =)

So remember, when trying to generate a build for Unity Android, NEVER keep an instance of Visual Studio with a Xamarin Project open at the same time, and everything should work as expected!

Have you had the same problem and this article helped you? Please leave a comment here comment!

Thank you and see you next time! Peace and Live Longer and Prosper! 🖖

Leave a Reply

Your email address will not be published. Required fields are marked *