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

EAS构建失败:Task :expo-crypto:compileReleaseKotlin错误求助

EAS构建失败:expo-crypto模块编译错误(未显式依赖该模块)

问题详情

  • 从传统构建迁移至EAS,Android构建在Task :expo-crypto:compileReleaseKotlin步骤失败
  • 裸工程与托管工作流均出现此问题
  • 使用Expo CLI 5.2.0、Expo SDK 44.0.0
  • 项目未主动使用expo-crypto,package.json中无该依赖

错误日志

[stderr] e: /home/expo/workingdir/build/node_modules/expo-crypto/android/src/main/java/expo/modules/crypto/CryptoModule.kt: (10, 5): Unresolved reference: Name
[stderr] e: /home/expo/workingdir/build/node_modules/expo-crypto/android/src/main/java/expo/modules/crypto/CryptoModule.kt: (12, 5): Interface Function does not have constructors
[stderr] e: /home/expo/workingdir/build/node_modules/expo-crypto/android/src/main/java/expo/modules/crypto/CryptoModule.kt: (13, 5): Unresolved reference: AsyncFunction
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
333 actionable tasks: 333 executed
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':expo-crypto:compileReleaseKotlin'.
[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[stderr]    > Compilation error. See log for more details
[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 7m 38s

解决方案

  • 锁定expo-crypto兼容版本:项目可能通过依赖树间接引入了不兼容的expo-crypto版本,在package.json中添加明确依赖:
    "expo-crypto": "~10.1.0"
    
    执行npm install或yarn install后重新构建
  • 清理依赖缓存:
    1. 删除node_modules、package-lock.json(或yarn.lock)
    2. 运行npx expo install --fix自动修复依赖版本不一致问题
  • 检查EAS构建配置:确认eas.json中的构建配置未强制引入额外模块,若有多余配置可移除
  • 更新Expo CLI:SDK 44推荐使用Expo CLI 5.x的稳定版本,可尝试升级到5.4.12,执行npm install -g expo-cli@5.4.12

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.19 22:35:15