1. Fault
Android studio start error: internal error
java.util.concurrent.CompletionException: java.net.BindException: Address already in use
the IDE cannot be opened due to such an error
2. General solutions
According to the analysis of many people, it is necessary to use Netsh Winsock reset on CMD to reset the network:
netsh winsock reset
If you restart your computer and open Android Studio again, you can open it successfully if you open it immediately, but if you open Android Studio after a while after your computer restarts, you may still report an error and cannot open it. There is also a possibility that if you open it this time, you will not be able to open it again next time.
So this solution does not work.
On the Internet, there are also those who turn off the firewall, and add a line of code disable.android.first.run=true at the end of Android Studio\bin\idea.properties in the installation directory, but they are not reliable.
Uninstall Android Studio and reinstall it.
3. The ultimate solution
Android Studio will start the server on the local host for internal processes and try to bind on any port between 6942 and 6991. And the computer Hyper-V will reserve many ports, once the ports 6942~6991 are in reserved state, Android Studio cannot be opened (report java.util.concurrent.CompletionException: java.net: Address already in use error).
Check the reserved port using the command.
netsh int ipv4 show excludedportrange protocol=tcp
Solution: exclude the port range we need and don’t let Hyper-V keep it
Restart the computer, open CMD with administrator authority
, and enter the following instructions:
netsh int ip add excludedportrange protocol=tcp startport=6942 numberofports=50
It’s that simple. If you solve the problem, there will be no problem that Android studio can’t open and report errors in the future.
Such errors may occur when using the above instructions:
This is because, after restarting the computer, the commands are entered too slowly and are taken up by Hyper-V before they have a chance to be executed. Remember to be fast.
Or, go to the BIOS to turn Hyper-V off, then start the computer, slowly enter the above instructions, and when the instructions are finished, go to the BIOS to turn on Hyper-V
Read More:
- Error running ‘Android Debugger (-1)‘ [How to Solve]
- [Solved] Android Studio Compile Error: Could not determine java version from ‘11.0.8‘.
- [Solved] Android Studio Change Project Error: Error while executing: am start
- [Solved] Android Studio Error: CreateProcess error = 206 file name or extension is too long
- [Solved] Windows Android Studio Cannot Start Error: Internal error. Please refer to https://code.google.com/p/android/issue
- [Solved] Failed to install the following Android SDK packages as some licences have not been accepted
- Nacos Error: server is DOWN now, please try again later! [How to Solve]
- Start Docker Quickstart Terminal error This computer is running Hyper-V. VirtualBox won’t boot a 64bits VM when Hyper-V is activated
- [Solved] Manifest merger failed: Apps targeting Android 12 and higher are required to specify an explicit
- [Solved] Android mediaplayer.prepare() Error: Caused by: java.lang.IllegalStateException
- Windows Install Docker Error: Cannot enable Hyper-V service
- React-native Error: Make sure you have the Android development environment set up [Solved]
- [Solved] – npm run dev Error: listen EADDRINUSE: address already in use :::8000(or 8080 etc.)
- Android studio does not prompt error messages [How to Solve]
- Monkey error: error: A RuntimeException occurred [How to Solve]
- How to Solve Error while executing: am start -n
- Apktool back compilation error [How to Solve]
- Remember an android app startup error Error running: Default Activity not found
- [Vagrant] When vagrant up, it stops at “SSH auth method: private key” and times out.
- Mac Appium Error: Error executing adb Exec. Original error…