我有一个项目在模拟器和设备上构建和运行良好,但归档时失败。
该项目很旧,但我创建了一个单独的组件,并添加到工作区中。
主项目是用 Objective-C 编写的,新项目是用 Swift 4 编写的。该项目也使用 CocoaPods,还包括另一个用 Swift 3.2 编写的子项目
有各种错误都归结为同一件事,子项目在编译时没有产生任何输出。或者它只是没有编译。我在代码本身中没有看到任何错误,只是在尝试引用它时:
//1
error: /Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/Intermediates.noindex/ArchiveIntermediates/<app name>/BuildProductsPath/Release-iphoneos/Framework.framework: No such file or directory`
//2
Signing Identity: "iPhone Developer: <redacted>“
/Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/Intermediates.noindex/ ArchiveIntermediates/<app name>/InstallationBuildProductsLocation/Applications/<app name>/Frameworks/<framework>.framework: No such file or directory
Command /usr/bin/codesign failed with exit code 1
//3
@import ModuleName;
Module ‘ModuleName’ not found
这是我尝试过的:
$(SRCROOT)
到 Main Target > Build Settings > Framework Search Paths > ReleaseSkip install
设置为 YES
在子项目build设置中pod update
Always Embed Standard Swift Libraries
无论哪种方式都没有区别其他说明:
/Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/ Intermediates.noindex/ArchiveIntermediates/<app name>/ InstallationBuildProductsLocation/Applications/<app name>.app/Frameworks/
其他子项目和所有 pod 都有一个 .framework 文件,但这个没有podfile
, use_frameworks!
存在更新:
今天运行存档后,我只看到错误:
Module 'ModuleName' not found
其他错误消失了
最佳答案
问题与 iOS 部署目标
设置有关:
在 Debug
中它只为当前架构构建,在 Release
中它为所有人构建。一旦你知道就很明显了。
将子项目设置为为 iOS 10 构建修复了该问题。
最令人沮丧的部分:我仔细检查了构建日志,它没有在任何地方提及版本问题:(
https://stackoverflow.com/questions/47528818/