Gradle 构建版本在全新安装和空项目上永久运行
2022-09-03 04:29:32
Gradle构建永远运行,我不知道为什么。
我已经在Ubuntu 15.04上安装了Android Studio。它是使用向导中的所有默认选项设置的。
我创建了一个空项目,我没有添加任何代码。当我尝试构建项目时,一个 gradle 进程启动,但永远不会终止。我尝试过让它运行一个小时,但没有进展。我最终不得不手动杀死gradle才能关闭Android Studio。(通过“ps aux |格雷普·格拉德尔;杀死-9“)
我使用的是open-jdk 1.7,但我也尝试过使用oracle java(具有相同的结果)。
我的台式机有 32 GB 内存。我试图增加分配给Android Studio的内存量,但没有效果。
我的 CPU 采用 AMD-64 架构。虽然我在谷歌上找不到任何东西表明这是我的困境的原因,但它应该负责吗?
当我手动运行 studio.sh 时,终端中没有出现错误消息。以下是终端输出(由我注释):
#starting Android Studio
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Starting process 'command '/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java''. Working directory: /home/cody/Documents/AndroidStudio/MyApplication Command: /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java -version
Successfully started process 'command '/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java''
#gradle starts up, this never terminates unless I terminate it myself
Starting daemon process: workingDir = /home/cody/.gradle/daemon/2.4, daemonArgs: [/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=UTF-8, -Duser.country=US, -Duser.language=en, -Duser.variant, -cp, /home/cody/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-launcher-2.4.jar, org.gradle.launcher.daemon.bootstrap.GradleDaemon, 2.4, /home/cody/.gradle, /home/cody/.gradle/daemon, 10800000, fb6e1111-7ac5-4afc-9630-890712f3195f, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=UTF-8, -Duser.country=US, -Duser.language=en, -Duser.variant]Starting process 'Gradle build daemon'. Working directory: /home/cody/.gradle/daemon/2.4 Command: /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /home/cody/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-launcher-2.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 2.4 /home/cody/.gradle /home/cody/.gradle/daemon 10800000 fb6e1111-7ac5-4afc-9630-890712f3195f -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant
Successfully started process 'Gradle build daemon'
An attempt to start the daemon took 0.99 secs.
Connected to daemon DaemonInfo{pid=9307, address=[98dcf537-f8f6-4e74-ad4d-c57a86d4a6c1 port:48946, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]], idle=false, context=DefaultDaemonContext[uid=fb6e1111-7ac5-4afc-9630-890712f3195f,javaHome=/usr/lib/jvm/java-7-openjdk-amd64,daemonRegistryDir=/home/cody/.gradle/daemon,pid=9307,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]}. Dispatching request Build{id=0ec396f9-4092-4fd1-93c4-0837d861cb85.1, currentDir=/home/cody/Documents/AndroidStudio/MyApplication}.
#I manually kill gradle
The message received from the daemon indicates that the daemon has disappeared.