Search Unity

Bug Android "Development Build" Socket Bind errors

Discussion in 'Linux' started by Nicholas-Rishel, Aug 27, 2015.

  1. Nicholas-Rishel

    Nicholas-Rishel

    Joined:
    May 7, 2013
    Posts:
    16
    When creating a Development Build for Android I get the following error:

    Code (UnityConsole):
    1. 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.
    2. [Path to Android SDK]/platform-tools/adb -s [Device ID] forward "tcp:54999" "localabstract:Unity-com.[Company Name].[App Name]"
    3.  
    4. stderr[
    5. error: cannot bind to socket
    6. error: cannot bind to socket
    7. ]
    8. stdout[
    9.  
    10. ]
    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.
     
    Last edited: Aug 27, 2015
    CanisLupus and tarasfromlviv like this.
  2. CarolBrandao

    CarolBrandao

    Joined:
    Aug 30, 2015
    Posts:
    2
    I have the same problem..
     
  3. StewVanB

    StewVanB

    Joined:
    Apr 12, 2011
    Posts:
    74
    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()
     
  4. Justice_Developer

    Justice_Developer

    Joined:
    Mar 23, 2014
    Posts:
    13
  5. kitabalef

    kitabalef

    Joined:
    Mar 14, 2015
    Posts:
    1
    I have same error
     
  6. Chaoseiro

    Chaoseiro

    Joined:
    Aug 28, 2013
    Posts:
    40
    +1 :/
    [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.
     
    Last edited: Sep 25, 2015
  7. Rihtarich-Alexander

    Rihtarich-Alexander

    Joined:
    Nov 15, 2013
    Posts:
    2
    I have the same problem. How fix?
     
  8. JakubNei

    JakubNei

    Joined:
    Jul 20, 2013
    Posts:
    26
  9. Shoopen

    Shoopen

    Joined:
    Mar 14, 2015
    Posts:
    7
    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.

     
  10. Eraph

    Eraph

    Joined:
    Aug 15, 2015
    Posts:
    45
    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.
     
  11. mpiastowski

    mpiastowski

    Joined:
    Jun 16, 2015
    Posts:
    6
    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).
     
  12. Nicholas-Rishel

    Nicholas-Rishel

    Joined:
    May 7, 2013
    Posts:
    16
    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...".
     
  13. dirkson

    dirkson

    Joined:
    Mar 4, 2017
    Posts:
    19
    I still have this issue in 5.6.0f3 ("final")
     
  14. AlienTechLAB

    AlienTechLAB

    Joined:
    Jan 5, 2017
    Posts:
    1
    Hi. I had similar problem. Here is my work around:
     
    ecv80 likes this.
  15. ecv80

    ecv80

    Joined:
    Oct 1, 2017
    Posts:
    28
  16. ef-silentiumapps

    ef-silentiumapps

    Joined:
    Feb 26, 2018
    Posts:
    1
    How can I do that in Windows?