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

React Native0.65安卓构建失败:无法转换react-native-reanimated-65-jsc.aar

安卓构建失败修复方案

错误根源

报错核心是当前项目安装的react-native-reanimated版本与React Native 0.65.0不兼容,构建时找不到对应RN 0.65版本的JSC架构aar包。

具体修复步骤

  • 第一步:卸载当前版本的react-native-reanimated
    执行命令:
    # npm用户执行
    npm uninstall react-native-reanimated
    # yarn用户执行
    yarn remove react-native-reanimated
    
  • 第二步:安装匹配RN 0.65的reanimated指定版本
    执行命令:
    # npm用户执行
    npm install react-native-reanimated@2.3.1
    # yarn用户执行
    yarn add react-native-reanimated@2.3.1
    
  • 第三步:清理残留缓存与构建产物
    依次执行以下操作:
    1. 删除项目根目录下的node_modules文件夹、package-lock.json或yarn.lock文件
    2. 进入项目android目录,执行清理命令:
      # Windows系统执行
      gradlew.bat clean
      # Mac/Linux系统执行
      ./gradlew clean
      
    3. 清理npm/yarn缓存:
      # npm用户执行
      npm cache clean --force
      # yarn用户执行
      yarn cache clean
      
  • 第四步:重新安装项目依赖
    执行命令:
    # npm用户执行
    npm install
    # yarn用户执行
    yarn install
    
  • 第五步:检查babel配置并重置缓存
    打开项目根目录的babel.config.js,确认plugins数组中已添加reanimated插件:
    module.exports = {
      presets: ['module:metro-react-native-babel-preset'],
      plugins: ['react-native-reanimated/plugin'], // 确保存在这一行
    };
    
    配置完成后执行命令重置metro缓存:
    npx react-native start --reset-cache
    
  • 第六步:重新执行安卓安装命令
    执行命令:
    npx react-native run-android
    

可选检查项

如果执行上述步骤后仍报错,打开项目android/gradle.properties文件,确认以下配置已开启且未被注释:

android.enableJetifier=true

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.07 09:54:04