gpt4 book ai didi

java - React Native Expo eas build -p android java JDK 版本错误

转载 作者:行者123 更新时间:2023-12-05 00:13:00 29 4
gpt4 key购买 nike

运行 eas build -p android 会产生以下结果:

stderr] FAILURE: Build failed with an exception.
[stderr] * Where:
[stderr] Build file '/home/expo/workingdir/build/android/app/build.gradle' line: 1
[stderr] * What went wrong:
[stderr] A problem occurred evaluating project ':app'.
[stderr] > Failed to apply plugin 'com.android.internal.application'.
[stderr] > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
[stderr] You can try some of the following options:
[stderr] - changing the IDE settings.
[stderr] - changing the JAVA_HOME environment variable.
[stderr] - changing `org.gradle.java.home` in `gradle.properties`.
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 40s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

我看不到从我的 expo 托管项目的 android 文件夹中升级我的 java jdk 版本的位置,并且当前版本 1.8 似乎没有在任何地方列出。构建在 eas 服务器上运行,所以我怀疑指向本地 JDK 路径会做任何事情。

最佳答案

我也有同样的错误。以下解决方案为我解决了 Java 11 vs 8 问题,但我现在遇到了另一个错误 - 无法创建任务 ':app:prepareLintJarForPublish'。

here了解更多信息。原来eas默认是使用jdk 8。

解决方案:

将此添加到您的 eas.json 文件中

"production": {
"android": {
"image" : "latest"
}
}

关于java - React Native Expo eas build -p android java JDK 版本错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71502070/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com