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

Expo 46项目EAS iOS构建失败,如何在eas.json/app.json配置ENABLE_BITCODE?

Expo 46 EAS构建Bitcode错误解决及配置方法

问题描述

使用EAS构建React Native Expo 46版本应用时,遇到以下错误:

ld: '/Users/expo/Library/Developer/Xcode/DerivedData/.../FBAEMKit.framework/FBAEMKit' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/expo/Library/Developer/Xcode/DerivedData/.../Build/Intermediates.noindex/ArchiveIntermediates/.../FBAEMKit.framework/FBAEMKit' for architecture arm64

想知道能否在eas.json或app.json中配置Xcode的ENABLE_BITCODE设置?

解决方案

可以通过EAS配置文件或Expo插件修改该设置,具体有两种可行方案:

方案一:通过eas.json直接设置Xcode构建参数

在eas.json的对应构建环境配置中,添加xcodeBuildArguments禁用bitcode(第三方库FBAEMKit不支持bitcode,禁用是唯一可行方案):

{
  "build": {
    "production": {
      "ios": {
        "buildConfiguration": "Release",
        "xcodeBuildArguments": {
          "ENABLE_BITCODE": "NO"
        }
      }
    },
    "preview": {
      "ios": {
        "xcodeBuildArguments": {
          "ENABLE_BITCODE": "NO"
        }
      }
    }
  }
}

该配置会在EAS构建时直接传递参数给Xcode,修改对应目标的ENABLE_BITCODE设置。

方案二:使用expo-build-properties插件(推荐)

  1. 先安装插件:
npx expo install expo-build-properties
  1. 在app.json或app.config.js的plugins数组中添加配置:
{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "bitcode": false
          }
        }
      ]
    ]
  }
}

这个插件会自动修改Xcode项目中的ENABLE_BITCODE为NO,无需手动处理Xcode配置,适配Expo 46及以上版本。

注意事项

  • 不要尝试启用bitcode:FBAEMKit框架本身未包含bitcode,无法通过启用bitcode解决问题,禁用目标的bitcode是正确方向。
  • Expo 46无法直接在app.json中设置Xcode构建参数,必须借助插件或eas.json的xcodeBuildArguments。
  • 确保配置覆盖所有需要构建的环境(比如production、preview)。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.13 12:05:13