I have a project which builds and runs fine on the simulator and device, but fails when archiving.
The project is very old, but I have created a separate component which I have added in the workspace.
The main project is written in Objective-C, the new project is written in Swift 4. The project also uses CocoaPods and also includes another subproject written in Swift 3.2
There are various errors which all boil down to the same thing, the sub project is not producing any output when it is compiled. OR it is just not compiled. I see no errors in the code itself, just when trying to reference it:
//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
Here’s what I’ve tried:
$(SRCROOT)
to Main Target > Build Settings > Framework Search Paths > ReleaseSkip install
set to YES
in Subproject build settingspod update
Always Embed Standard Swift Libraries
makes no difference either wayOther notes:
/Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/ Intermediates.noindex/ArchiveIntermediates/<app name>/ InstallationBuildProductsLocation/Applications/<app name>.app/Frameworks/
there is a .framework file for the other sub project and all the pods, but not for this onepodfile
, use_frameworks!
is presentUpdate:
After running an archive today I am only seeing the error:
Module 'ModuleName' not found
The other errors are gone
Start your archiveNavigate to your project's settings. Under iOS (or the target you want to build your app for) > Identity, you'll want to increment the Build number. For example, if the Build number was 1, you'll want to set it to 2. Then, in the top menu, under Product, click on Archive.
Xcode created your archive. The actual . xcarchive folder resides on your Mac in ~/Library/Developer/Xcode/Archives.
It should by located in: ~/Library/Developer/Xcode/DerivedData .
The issue was to do with the iOS Deployment Target
setting:
In Debug
it is building only for the current architecture, in Release
it builds for all. Obvious once you know.
Setting the sub project to build for iOS 10 fixed the issue.
The most frustrating part: I double checked the build log and it doesn't mention the version issue anywhere :(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With