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

M1芯片Mac使用Xcode12.5.1运行项目报library not found for -lBVLinearGradient错误

M1芯片Mac运行RN项目lBVLinearGradient链接报错解决方案

报错原文

ld: library not found for -lBVLinearGradient
clang: error: linker command failed with exit code 1 (use -v to see invocation)

适用场景

搭载M1芯片的Macbook Pro设备,Xcode 12.5.1版本,项目依赖react-native-linear-gradient@2.5.6

修复步骤

  • 打开Xcode项目,进入对应TARGETS的Build Settings页,搜索Library Search Paths,确保配置项中存在$(inherited),属性设置为递归(recursive)
  • 清理本地缓存文件:删除项目根目录下的node_modules文件夹、ios目录下的Pods文件夹与Podfile.lock文件
  • 重新安装依赖:在项目根目录执行yarn install或npm install
  • 适配M1架构执行pod安装:进入ios目录,执行arch -x86_64 pod install
  • 清空Xcode编译缓存:按下Command + Shift + K,之后重新运行项目即可

备选临时修复方案

如果上述操作后仍存在报错,可降级依赖版本解决:

  • 执行yarn add react-native-linear-gradient@2.5.3安装兼容版本,重新执行pod安装步骤后运行项目

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.05 13:45:04