Android "Development Build" Socket Bind errors

When creating a Development Build for Android I get the following error:

Error building Player: CommandInvokationFailure: Unable to forward network traffic to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
[Path to Android SDK]/platform-tools/adb -s [Device ID] forward "tcp:54999" "localabstract:Unity-com.[Company Name].[App Name]"

stderr[
error: cannot bind to socket
error: cannot bind to socket
]
stdout[

]

Via netstat no other application had control of that port. Disabling development builds fixes the issue. Development builds for Linux x86_64 didn’t have this issue. Confirmed this issue existed with the default Unity scene with nothing added.

2 Likes

I have the same problem…

I am getting this error as well, my android project stopped building when I updated to 5.2.

Log:

CommandInvokationFailure: Unable to forward network traffic to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
Z:/AndroidStudio_SDK\platform-tools\adb.exe -s [DeviceID] forward “tcp:54999” “localabstract:Unity-com.stewart.dndhelperapp”

stderr[
error: cannot bind to socket: No error
error: cannot bind to socket: No error
]
stdout[

]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.ADB.RunInternal (System.String[ ] command, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.ADB.Run (System.String[ ] command, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidDevice.Exec (System.String[ ] command, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidDevice.Forward (System.String pc, System.String device, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit)
UnityEditor.Android.PostProcessAndroidPlayer.UploadAndStartPlayer (System.String manifestName, System.String stagingArea, UnityEditor.Android.AndroidDevice device, System.String packageName, Boolean developmentPlayer, Boolean retryUpload)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.HostView:OnGUI()

Same here

I have same error

+1 :confused:
[On a side note: unity remote works almost flawlessly :)]
[Edit 2] The profiler correctly works, so the problem is only in the binding after the build. Manually connecting the Profiler to Android works fine.

I have the same problem. How fix?

Relevant question & fix Unity android Unable to forward network traffic to device - Questions & Answers - Unity Discussions

Hi guys!
Does somebody know the fix for this error when buillding in development build? I need development build checked to connect the profiler to my device, but i can’t - this error occurs.

I get this error, but the game is deploying, it’s as if it just can’t start it remotely. Now, I had it deployed from Windows so I had the launcher icon showing already, I’m not sure if that’s part of the process that’s failing. Are any of you seeing the launcher icon? The APK should still be on your device, maybe have a go at installing it manually.

I had the same problem on Windows. It seems strange, but removing Temp and Library folders helped (Unity recreates both, but make backup before you apply this solution).

Temp and Library can both be deleted without backup; it’s standard practice to ignore them in version control.

That said the actual issue is probably that Unity has zombie processes which aren’t releasing files which later are trying to be reopened. I would bet that the actual issue is in Temp, not Library.

You might be able to isolate the zombie process in a terminal, type “lsof +D Temp” see which process IDs have hold of several files, then “kill [1st process id] [2nd…”.

I still have this issue in 5.6.0f3 (“final”)

Hi. I had similar problem. Here is my work around:

1 Like

You should publish this here too https://answers.unity.com/questions/1071056/unity-android-unable-to-forward-network-traffic-to.html

This is the only fix that worked for me. Thank you!

How can I do that in Windows?