解决netflix maestro执行./gradlew build报错

 

build.gradle文件中:

java {
        toolchain {
            languageVersion = JavaLanguageVersion.of(21)
        }
    }
JavaLanguageVersion为21,于是jdk使用的 java 21

执行报错:
no matching toolchains found for requested specification languageversion=21

解决:
Add the following lines to your settings.gradle(.kts):

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0'
}

https://youtrack.jetbrains.com/issue/KTIJ-24981/Gradle-8.-project-sync-fails-with-an-error-No-matching-toolchains-found-for-requested-specification-if-there-is-no-necessary-JDK


修改完后,报错:
JVM crash log found: file:///Users/phoenix/Documents/myproject/maestro/hs_err_pid23909.log

FAILURE: Build failed with an exception.

* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

查看log:
# Problematic frame:
# C [libnative-platform-file-events.dylib+0x0] __dso_handle+0x0
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again


google搜索后,在github发现,Gradle 8.8 crashed on MacOS 11.x (8.7 still works as expected) #29476。
而我的macOS版本是11.7.10。

解决:

于是尝试把 gradle的版本从 8.8改成8.7, 修改gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip。最后build success

https://github.com/gradle/gradle/pull/29514

 

posted @ 2024-07-26 17:23  parkdifferent  阅读(57)  评论(0编辑  收藏  举报