Search code examples
javaandroidandroid-studiogradlehttpserver

Internal HTTP server and gradle refresh error on Android Studio


I was using AS perfectly without any issues. When I imported a project downloaded via github. And after resolving some build issues I managed to ran the program but it caused problem with AS and I had close it forcefully. When I restarted my AS it pop up firstly with this error.

cannot start internal http server. git integration, javascript debugger and liveedit may operate with errors. please check your firewall settings and restart android studio

Then I googled and found some solutions of which I tried these:

  • Disable Antivirus or firewall.
  • Run network command netsh winsock reset
  • Remove all gradle related files and restart.
  • Remove all android related files(SDK, .android folder etc) and reinstall android with no previous settings.

    All of these didn't work and another problem came up.

     Gradle 'My Aplication' project refresh failed - Error:Protocol family unavailable
    

    For this problem I added following line in my environment variables

     _JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true
    

    but this didn't resolved my issue. So I again reinstalled AS from beginning. Now I am having two issues

    Gradle 'My Aplication' project refresh failed. <br>
        Error:Could not connect to server [ff117fd1-1e60-4433-87c8-b03c2c38eba0 port:55537, addresses:[/127.0.0.1]]. Tried addresses: [/127.0.0.1].
    

    And other issue is

    cannot start internal http server. git integration, javascript debugger and liveedit may operate with errors. please check your firewall settings and restart android studio
    

    I have searched everywhere but couldn't find any solution for these two issues.

    • Windows 10 OS
    • Android Version : Android Studio 2.3.3 Build #AI-162.4069837
    • Wamp Server is installed and working

Please help me with this issue. Thanks in advance.


Solution

  • Actually I found the solution to my problem. I don't know what exactly worked for me but after following these steps my problem was resolved.

    1. Uninstall Android Studio(save the user settings if you want to).
    2. Uninstall other programs which uses server port on the system.(like wamp)
    3. Disable/uninstall antivirus on the system.
    4. Delete all related folders (.gradle,.android,.AndroidStudioProjects etc from user's folder Android folder from local folder in app data) and restart system.
    5. Install android studio and make sure firewall/antivirus is disabled.
    6. Import settings if you want but don't import settings for gradle, httpserver, internal server, git, javascript debugger and others which were causing problem earlier.
    7. Install the SDK and Emulator and other SDK tools.

    Enjoy