- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试启动 Android Studio 并不断收到 Gradle 错误。查看守护程序日志,守护程序似乎只接受来自 IPv6 连接或 127.0.0.1 的连接。
但是,我不知道如何让它接受其他连接或使用 IPv6。我曾尝试在各个地方添加 IPv6 标志,但无济于事。
请注意,代码遍历我的网络接口(interface),但仍然只接受 127.0.0.1 连接。
错误本身来自这部分 Gradle 代码:
这是日志文件:
17:49:57.451 [INFO] [org.gradle.launcher.daemon.server.Daemon] start() called on daemon - DefaultDaemonContext[uid=f2ffb085-b7ad-446a-983d-d6d47a3ae4c0,javaHome=/usr/lib/jvm/java-7-oracle,daemonRegistryDir=/home/whistlepig/.gradle/daemon,pid=7040,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
17:49:57.466 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] updating lastActivityAt to 1422226197466
17:49:57.477 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface vboxnet0
17:49:57.478 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? false
17:49:57.479 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? true
17:49:57.481 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /fe80:0:0:0:800:27ff:fe00:0%4
17:49:57.483 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /192.168.56.1
17:49:57.487 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote multicast interface vboxnet0
17:49:57.488 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface p10p1
17:49:57.489 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? false
17:49:57.491 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? true
17:49:57.492 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /169.254.8.98
17:49:57.493 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote multicast interface p10p1
17:49:57.494 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface p9p1
17:49:57.496 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? false
17:49:57.497 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? true
17:49:57.499 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /fe80:0:0:0:12c3:7bff:fe46:5caf%2
17:49:57.500 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /10.0.0.45
17:49:57.501 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote multicast interface p9p1
17:49:57.503 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface lo
17:49:57.504 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? true
17:49:57.505 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? false
17:49:57.507 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding loopback address /0:0:0:0:0:0:0:1%1
17:49:57.508 [DEBUG] [org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding loopback address /127.0.0.1
17:49:57.515 [DEBUG] [org.gradle.messaging.remote.internal.inet.TcpIncomingConnector] Listening on [73551d2b-fa6b-4f37-8520-8694106b50e7 port:49792, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]].
17:49:57.521 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Sun Jan 25 17:49:57 EST 2015, with address: [73551d2b-fa6b-4f37-8520-8694106b50e7 port:49792, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]]
17:49:57.523 [INFO] [org.gradle.launcher.daemon.server.DomainRegistryUpdater] Advertising the daemon address to the clients: [73551d2b-fa6b-4f37-8520-8694106b50e7 port:49792, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]]
...
[org.gradle.messaging.remote.internal.inet.TcpIncomingConnector] Cannot accept connection from remote address /10.0.0.45.
最佳答案
我在安装新的 Android Studio 时遇到了非常相似的问题。花了最后 42 小时谷歌搜索并尝试各种修复。我很高兴我没有像一些人建议的那样删除我的防火墙——因为防火墙日志实际上帮助我诊断了这个问题的根本原因——即 Android Studio 正在从 IPv4 套接字向 Gradle Java 上的 IPv6 套接字发送消息.exe进程!
诊断出问题后,通过谷歌搜索正确答案是一个简单的步骤 - 在这篇文章中:https://superuser.com/questions/453298/how-to-force-java-to-use-ipv4-instead-ipv6
这对我来说已经解决了。
关于android - 如何修复 Android Studio 无法连接到 Gradle 守护进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28142986/
我正在开发一个 voip 调用应用程序。我需要做的是在接到来电时将 Activity 带到前台。我在应用程序中使用 Twilio,并在收到推送消息时开始调用。 问题是我试图在接到任何电话时显示 Act
我是一名优秀的程序员,十分优秀!