You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Expo构建React Native Android应用时Gradle编译失败求助

React Native + Expo Android构建失败求助

尝试用React Native和Expo生成Android构建包时,出现以下错误:
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

部分日志内容:

10 errors
> Task :app:compileDebugJavaWithJavac FAILED
> Task :react-native-quick-base64:configureCMakeDebug[armeabi-v7a]
C/C++: CMake Warning (dev) in CMakeLists.txt:
C/C++:   No project() command is present.  The top-level CMakeLists.txt file must
C/C++:   contain a literal, direct call to the project() command.  Add a line of
C/C++:   code such as
C/C++:     project(ProjectName)
C/C++:   near the top of the file, but after cmake_minimum_required().
C/C++:   CMake is pretending there is a "project(Project)" command on the first
C/C++:   line.
C/C++: This warning is for project developers.  Use -Wno-dev to suppress it.
> Task :expo-modules-core:buildCMakeDebug[arm64-v8a]
> Task :react-native-reanimated:buildCMakeDebug[arm64-v8a]
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
612 actionable tasks: 612 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.
BUILD FAILED in 7m 8s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

已尝试的操作:

  • 执行expo-doctor命令,未检测出任何问题
  • 修改gradle\wrapper目录下gradle-wrapper.properties文件的distributionUrl为distributionUrl=https://services.gradle.org/distributions/gradle-8.2-all.zip,问题依旧存在

恳请协助排查问题。

内容的提问来源于stack exchange,提问作者Lima

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 21:53:18