0

Android Studio starts failed My JDK is a OpenJDK 15 from RedHat with OpenJFX. I also tried OpenJDK 8 JRE, it doesn't work. I tried reinstall it, disconnect Internet, add a line into idea.properties, problem still.

The file

%appdata%\..\Local\Google\AndroidStudio2020.3\log\idea.log

contains the following content:

2021-08-19 17:30:28,532 [    835]   INFO -                         STDERR -  
2021-08-19 17:30:28,532 [    835]   INFO -                         STDERR - Start Failed 
2021-08-19 17:30:28,532 [    835]   INFO -                         STDERR - Internal error. Please refer to https://code.google.com/p/android/issues 
2021-08-19 17:30:28,532 [    835]   INFO -                         STDERR -  
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR - java.util.concurrent.CompletionException: java.net.BindException: Address already in use: bind 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.security.AccessController.doPrivileged(Native Method) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/java.lang.Thread.run(Thread.java:834) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR - Caused by: java.net.BindException: Address already in use: bind 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/sun.nio.ch.Net.bind0(Native Method) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/sun.nio.ch.Net.bind(Net.java:455) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/sun.nio.ch.Net.bind(Net.java:447) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) 
2021-08-19 17:30:28,533 [    836]   INFO -                         STDERR -     ... 1 more 
2021-08-19 17:30:28,534 [    837]   INFO -                         STDERR -  
2021-08-19 17:30:28,534 [    837]   INFO -                         STDERR - ----- 
2021-08-19 17:30:28,534 [    837]   INFO -                         STDERR - Your JRE: 11.0.10+0-b96-7249189 amd64 (Oracle Corporation) 
2021-08-19 17:30:28,534 [    837]   INFO -                         STDERR - D:\Program Files\Android\Android Studio\jre 

Actually the problem is solved by rebooting the computer, but I still wonder why this happened.

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
MiKayule
  • 11
  • 2
  • Maybe [the logs](https://stackoverflow.com/questions/19784877/how-to-find-the-logs-on-android-studio/19809551) contain some more information. Ignore the first answer, as that one only applies when you can start the IDE. – Joachim Sauer Aug 19 '21 at 09:40
  • Please don't reference external resources. Edit the question to include the log (or relevant portions, if it's too big). – Joachim Sauer Aug 19 '21 at 09:49
  • It seems like the IDE wanted to listen on some local port that was already in use. It's not obvious from this stack trace for what purpose it tried to listen there. Restarting probably just freed up the port. – Joachim Sauer Aug 19 '21 at 10:07
  • Question edited. – MiKayule Aug 19 '21 at 10:07

1 Answers1

1

Eventually I fixed this problem by rebooting the computer.

It seems that this problem is caused by a port that Idea needs was already in use.

MiKayule
  • 11
  • 2