【发布时间】:2026-01-24 19:30:02
【问题描述】:
我正在尝试归档使用 React Native 构建的(否则完美构建,在模拟器/设备上运行以进行调试)iOS 应用。
当我尝试在 Xcode 中存档时,它会正确编译和链接,但在尝试生成资产时会调用以下命令:
node '/Users/Can/Documents/Programming/React Native/REDACTED/node_modules/react-native/cli.js' bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/Can/Library/Developer/Xcode/DerivedData/REDACTED-eebdhuhscigvmvduljehleepetoi/Build/Intermediates.noindex/ArchiveIntermediates/REDACTED/BuildProductsPath/Release-iphoneos/REDACTED.app/main.jsbundle --assets-dest /Users/Can/Library/Developer/Xcode/DerivedData/REDACTED-eebdhuhscigvmvduljehleepetoi/Build/Intermediates.noindex/ArchiveIntermediates/REDACTED/BuildProductsPath/Release-iphoneos/REDACTED.app
失败并出现错误:
error Unable to find React Native files. Make sure "react-native" module is installed in your project dependencies.. Run CLI with --verbose flag for more details.
(在你问之前,是的,react-native 显然安装在我的项目依赖项中)
当我手动调用那个确切的节点命令时,它会非常好地生成资产:
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, /Users/Can/Library/Developer/Xcode/DerivedData/REDACTED-eebdhuhscigvmvduljehleepetoi/Build/Intermediates.noindex/ArchiveIntermediates/REDACTED/BuildProductsPath/Release-iphoneos/REDACTED.app/main.jsbundle
info Done writing bundle output
info Copying 30 asset files
info Done copying assets
因此,我无法归档我的应用。它建议我使用 --verbose 标志运行 CLI,但我不知道在哪里添加标志,因为命令本身是从自动生成/复杂的脚本调用的。
我做错了什么?我在 Xcode 10.2 和 React Native 0.59.3 上。
【问题讨论】:
标签: ios xcode react-native xcodebuild xcode10