首页 > 解决方案 > Xcode 无法存档反应原生项目

问题描述

当我尝试归档我的 React Native 项目时出现此错误。

我能够在 iPhone 和模拟器上运行调试/发布。react-native run也可以。

我已经阅读了类似的问题并尝试过:

  1. 确保我打开xcworkspace而不是xcodeproj.

  2. 删除Podfile.lock并运行pod install和清理项目。

  3. 仅构建活动架构设置为

构建输出:

ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/DoubleConversion'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/Folly'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/Google-Maps-iOS-Utils'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/React'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/glog'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/react-native-google-maps'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/react-native-maps'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/react-native-video'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/yoga'
ld: library not found for -lDoubleConversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)

标签: iosreact-native

解决方案


您是否尝试将其关闭并重新打开?尝试重新启动 Mac,这些问题通常会消失。

在您的情况下,还可以尝试删除 DerivedData 的全部内容:

rm -rf /Users/mans/Library/Developer/Xcode/DerivedData/*

它是否适用于您从 GitHub 获得的一些新项目?


推荐阅读