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

安装expo-auth-session后Android构建失败:expo-crypto编译Release Kotlin失败

安装expo-auth-session后Android构建崩溃修复方案

错误详情

Task :expo-crypto:compileReleaseKotlin FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

错误说明:本次构建使用了已弃用的Gradle特性,与Gradle 8.0不兼容;可通过--warning-mode all参数查看具体弃用警告,定位问题来源。

修复步骤

  • 降级Gradle版本至7.x系列
    修改项目根目录下gradle/wrapper/gradle-wrapper.properties文件中的distributionUrl,指定7.x版本的Gradle:

    distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
    

    同步修改android/build.gradle中的Gradle插件版本,保证版本匹配(示例中Gradle 7.5.1对应插件7.4.2):

    buildscript {
        dependencies {
            classpath 'com.android.tools.build:gradle:7.4.2'
        }
    }
    
  • 更新expo相关依赖版本
    确认expo-auth-session和expo-crypto版本与当前Expo SDK兼容,在package.json中调整版本后执行依赖安装:

    npm install
    # 或使用yarn
    yarn install
    
  • 定位具体弃用警告
    执行构建命令时添加--warning-mode all参数,获取详细警告信息:

    ./gradlew assembleRelease --warning-mode all
    

    根据输出的具体警告,针对性修改对应脚本或插件配置。

  • 清理构建缓存
    清理缓存后重新构建,避免缓存导致的异常:

    ./gradlew clean
    npm run android
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.16 09:01:00