Unity android Unable to forward network traffic to device

Tried building to phone for testing today and am getting this error:
54871-err.png
and the 2 console error reports:

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. 
D:/androidsdk/platform-tools\adb.exe -s "4f0c7edb" forward "tcp:54999" "localabstract:Unity-com.maincharacter.test"

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.BuildPlayerWindow:BuildPlayerAndRun()

and:

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. 
D:/androidsdk/platform-tools\adb.exe -s "4f0c7edb" forward "tcp:54999" "localabstract:Unity-com.maincharacter.test"

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

]

I’m on Unity5 with android SDK rev 24.3.4. Any help here would be awesome. If you’ll pardon the cliche, It was working fine yesterday.

Worked around it by disabling Development Build in Build Settings, Debug.Log* still works

Hi,
Here is my fix :

Open Cmd with admin permissions and run this command:

netstat -a -o -n | find “54999”

This will show the id of the proccess let’s say it shows :

TCP 0.0.0.0:54999 0.0.0.0:0 LISTENING 14824

Just write :

taskkill /F /PID 14824

To make sure everything is clean, you can run things manually before opening unity. :

adb forward --remove-all

adb -s “4f0c7edb” forward “tcp:54999” “localabstract:Unity-com.maincharacter.test”
I hope this helps someone.
Thanks;

I’m using Unity 2017.1.0xb3 on Linux. I’m getting the following error

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.

platform-tools/adb -s “DEVICE” forward “tcp:34999” “localabstract:Unity-com.package”
stderr[
error: cannot bind listener: Address already in use
]

Unity is listening on port 34999.
I’ve tried build settings, disable “Development Build” and “adb forward --remove-all” no effect. I’m using the latest android sdk tools (sdk-tools-linux-3859397.zip). I also tried tools_r25.2.5-linux.zip but got the same error.

Any idea’s?

Thanks

Hi all! Someone told me to put link to one of my videos here, so here it is:

This is my workaround. I hope it helps you. It’s for Linux, but I think by analogy you can do something similar on Windows too.

I get the same issue runing on Linux Mint when I use ‘Build And Run’. If I only do the build, it generates the apk. When I manually install that apk, it works perfectly.
I am also able to run ‘cordova run android’ in the same environment, and it works. I don’t think its the SDK, it appears to me that the install fails and throws an invalid error message.

I found updating to the latest JDK fixes the issue (and you can leave development build checked).

Remember to set the new path in Edit->Preferences->External Tools.

Also I found USB 3.0 ports won’t work on my PC, has to be a USB 2.0. That is probably more down to the USB driver for my LG G3 though.

I had same problem. I was running 2 instances of Unity Editor. Opening only one I want to profile solved the problem.