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:
- Clear derived data
- Restart Mac
- Add
$(SRCROOT)
to Main Target > Build Settings > Framework Search Paths > Release - Confirmed project is present in Embedded Binaries
- Confirmed project is present in Linked Frameworks and Libraries
- Removing and re-adding project to embedded binaries and frameworks and libraries
- Removing the import declaration
- I am opening the workspace and not the project
Skip install
set toYES
in Subproject build settings- Comparing build settings from the working sub project with the failing one (they are the same)
- Running
pod update
- Changing
Always Embed Standard Swift Libraries
makes no difference either way
Other notes:
- In
/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 one - In
podfile
,use_frameworks!
is present
Update:
After running an archive today I am only seeing the error:
Module 'ModuleName' not found
The other errors are gone