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

React Native项目构建失败:AndroidManifest缺包名及Podfile错误求助

应用构建失败:未找到包名

执行npm/pod install后,/Users/runner/work/1/s/node_modules/react-native-image-picker/android/src/main/AndroidManifest.xml文件缺失包名,本地手动添加后流水线构建仍失败。

复现步骤

  • 执行npm install
  • 执行pod install

配置信息

  • "react-native": "0.70.5"
  • "react-native-image-picker": "^5.6.0"

补充报错信息

[!] Invalid Podfile file: 809: unexpected token at 'info Run CLI with --verbose flag for more details.

from /Users/runner/work/1/s/ios/Podfile:20
target 'Proxus' do
config = use_native_modules!

The process '/usr/local/lib/ruby/gems/3.0.0/bin/pod' failed with exit code 1

The 'pod' command failed with error: The process '/usr/local/lib/ruby/gems/3.0.0/bin/pod' failed with exit code 1


解决建议

  1. 修复Podfile语法问题
    报错明确指向Podfile第20行存在意外token,检查use_native_modules!的调用是否规范,或者Podfile中是否有括号不匹配、多余字符等语法错误。可以参考React Native 0.70官方Podfile模板调整。

  2. 用补丁替代手动修改node_modules
    流水线构建时会重新执行npm install,手动修改的node_modules文件会被覆盖,根本解决方法是用patch-package打补丁:

    • 本地修改node_modules/react-native-image-picker/android/src/main/AndroidManifest.xml补充包名
    • 执行npx patch-package react-native-image-picker生成补丁文件
    • 将补丁文件提交到代码仓库,流水线构建时会自动应用补丁
  3. 验证版本兼容性
    确认react-native-image-picker@5.6.0是否适配RN 0.70.5,若存在兼容性问题,查看该库的CHANGELOG或GitHub issues,降级到官方标注兼容的版本。

  4. 清理构建缓存
    流水线构建前添加缓存清理步骤:

    rm -rf node_modules && npm install
    cd ios && rm -rf Pods Podfile.lock && pod install
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.17 19:52:38