Until now our project and all associated pods have been in objective c. We wanted to use the latest version of PromiseKit and so added use_frameworks! to our podfile. Before adding PromiseKit to the PodFile, I confirmed the project runs. After adding PromiseKit to the podfile, I get a 'Command /bin/sh failed with exit code -1' saying 'PromiseKit.framework: bundle format unrecognized, invalid, or unsuitable.'
sent 2733061 bytes received 98 bytes 5466318.00 bytes/sec total size is 2732456 speedup is 1.00 Code Signing /Users/bryanboyko/XCode/HereOne-iOS/HereOne/Build/Products/Debug-iphoneos/HereOne.app/Frameworks/Parse.framework with Identity iPhone Developer: Bryan Boyko (2J2F768B2X) /usr/bin/codesign --force --sign 453628556ADD8E5593F102CEF9634DB02042AA98 --preserve-metadata=identifier,entitlements "/Users/bryanboyko/XCode/HereOne-iOS/HereOne/Build/Products/Debug-iphoneos/HereOne.app/Frameworks/Parse.framework" /Users/bryanboyko/XCode/HereOne-iOS/HereOne/Build/Products/Debug-iphoneos/HereOne.app/Frameworks/Parse.framework: replacing existing signature rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/bryanboyko/XCode/HereOne-iOS/HereOne/Build/Products/Debug-iphoneos/PromiseKit.framework" "/Users/bryanboyko/XCode/HereOne-iOS/HereOne/Build/Products/Debug-iphoneos/HereOne.app/Frameworks" building file list ... done PromiseKit.framework/
sent 102 bytes received 26 bytes 256.00 bytes/sec total size is 0 speedup is 0.00 Code Signing /Users/bryanboyko/XCode/HereOne-iOS/HereOne/Build/Products/Debug-iphoneos/HereOne.app/Frameworks/PromiseKit.framework with Identity iPhone Developer: Bryan Boyko (2J2F768B2X) /usr/bin/codesign --force --sign 453628556ADD8E5593F102CEF9634DB02042AA98 --preserve-metadata=identifier,entitlements "/Users/bryanboyko/XCode/HereOne-iOS/HereOne/Build/Products/Debug-iphoneos/HereOne.app/Frameworks/PromiseKit.framework" /Users/bryanboyko/XCode/HereOne-iOS/HereOne/Build/Products/Debug-iphoneos/HereOne.app/Frameworks/PromiseKit.framework: bundle format unrecognized, invalid, or unsuitable Command /bin/sh failed with exit code 1 `
After removing DerivedData, Pods, .xcworkspace, and Podfile.lock, and then pod installing, this error still occurs.
Could you please fill out the whole issue template? This is very little information to go from and I can't reproduce it with a fresh project.
Figured it out! Sorry for lack of info earlier.
I noticed that /Build/Products/Debug-iphoneos/HereOne.app/Frameworks/PromiseKit.framework was empty.
Removing the Build folder (in addition to removing DerivedData, Pods, .xcworkspace, and Podfile.lock before, and pod installing) solved the issue
by deleting DerivedData folder contents really works, thanks @bryanboyko
Same problem, but none of these solutions fixed it
mkdir -p /Users/User/Library/Developer/Xcode/DerivedData/Training-dxunveujqaknbkdxeaunfqkqeemq/Build/Products/Debug-iphoneos/Training.app/Frameworks
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/User/Library/Developer/Xcode/DerivedData/Training-dxunveujqaknbkdxeaunfqkqeemq/Build/Products/Debug-iphoneos/Alamofire/Alamofire.framework" "/Users/User/Library/Developer/Xcode/DerivedData/Training-dxunveujqaknbkdxeaunfqkqeemq/Build/Products/Debug-iphoneos/Training.app/Frameworks"
building file list ... done
Alamofire.framework/
Alamofire.framework/Alamofire
Alamofire.framework/Info.plist
sent 1807655 bytes received 70 bytes 3615450.00 bytes/sec
total size is 1807197 speedup is 1.00
Code Signing /Users/User/Library/Developer/Xcode/DerivedData/Training-dxunveujqaknbkdxeaunfqkqeemq/Build/Products/Debug-iphoneos/Training.app/Frameworks/Alamofire.framework with Identity iPhone Developer: User (334KZKBR5W)
/usr/bin/codesign --force --sign 04C3F387F2A70E0F7CAFB73CEDAB10271D19C342 --preserve-metadata=identifier,entitlements /Users/User/Library/Developer/Xcode/DerivedData/Training-dxunveujqaknbkdxeaunfqkqeemq/Build/Products/Debug-iphoneos/Training.app/Frameworks/Alamofire.framework
/Users/Bryan: bundle format unrecognized, invalid, or unsuitable
Command /bin/sh failed with exit code 1
I've closed Xcode, ran rm -rf ~/Library/Caches/CocoaPods; rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*; pod deintegrate deleted xcworkspace, Podfile.lock, and restarted the computer, then ran pod install again.
This all started running pod install a day go to add another dependency (I have since removed that addition to the Podfile in an effort to fix this issue
I have started seeing the same issue after after updating to cocoapods 1.2.0.beta.1.
What's interesting is that I was able to successfully archive build with Release config and right after that I got the error for AdHoc build (which is based on Release but uses different bundle id)
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp\ AdHoc/IntermediateBuildFilesPath/MyApp.build/AdHoc-iphoneos/MyApp.build/Script-74CC89DC75855ADE4FC8C121.sh
cd /Users/tomkraina/Developer/MyApp.cz/MyApp
/bin/sh -c \"/Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp\ AdHoc/IntermediateBuildFilesPath/MyApp.build/AdHoc-iphoneos/MyApp.build/Script-74CC89DC75855ADE4FC8C121.sh\"
mkdir -p /Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp AdHoc/BuildProductsPath/AdHoc-iphoneos/MyApp.app/Frameworks
Symlinked...
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp AdHoc/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AECoreDataUI.framework" "/Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp AdHoc/InstallationBuildProductsLocation/Applications/MyApp.app/Frameworks"
building file list ... done
AECoreDataUI.framework/
AECoreDataUI.framework/AECoreDataUI
AECoreDataUI.framework/Info.plist
sent 845511 bytes received 70 bytes 1691162.00 bytes/sec
total size is 845163 speedup is 1.00
Code Signing /Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp AdHoc/InstallationBuildProductsLocation/Applications/MyApp.app/Frameworks/AECoreDataUI.framework with Identity iPhone Distribution: MyApp s.r.o. (XXXXXXXX)
/usr/bin/codesign --force --sign 45743C93BB076B2C706CF2B65FD65E031E6706E1 --preserve-metadata=identifier,entitlements /Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp AdHoc/InstallationBuildProductsLocation/Applications/MyApp.app/Frameworks/AECoreDataUI.framework
/Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp: bundle format unrecognized, invalid, or unsuitable
Command /bin/sh failed with exit code 1
Now, after cleaning DerivedData, I got this in Xcode (ArchiveIntermediates/MyApp: No such file or directory):
Code Signing /Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp AdHoc/InstallationBuildProductsLocation/Applications/MyApp.app/Frameworks/AECoreDataUI.framework with Identity iPhone Distribution: MyApp s.r.o. (XXXXXXX)
/usr/bin/codesign --force --sign 45743C93BB076B2C706CF2B65FD65E031E6706E1 --preserve-metadata=identifier,entitlements /Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp AdHoc/InstallationBuildProductsLocation/Applications/MyApp.app/Frameworks/AECoreDataUI.framework
/Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp: No such file or directory
After further investigation I found out there's nothing at /Users/tomkraina/Library/Developer/Xcode/DerivedData/MyApp-cvaczztpccscyudjufchcurwotld/Build/Intermediates/ArchiveIntermediates/MyApp. However, there's a folder named MyApp AdHoc.
It seems that folders in ArchiveIntermediates get created with the name of the selected scheme. I have MyApp AdHoc scheme which I use for adhoc build. Cocoapods, for some reason, tries to find the compiled frameworks to sign them in ArchiveIntermediates/MyApp.
Could it be a regression in cocoapods 1.2.0.beta.1, maybe caused by https://github.com/CocoaPods/CocoaPods/pull/6088 ?
UPDATE: Yes, it's a regression caused by https://github.com/CocoaPods/CocoaPods/pull/6088. Cocoapods not escaping path to the framework correctly: https://github.com/benasher44/CocoaPods/commit/0d889c8c449be095b428deb9c1a9d8285ddb7381#commitcomment-19753329
YES! thank you! I was having the same problem and found this. My scheme name had a space in it and it was not being correctly escaped.
@tomaskraina So what was your solution?
@bryanboyko I was using Cocoapods installed from a specific commit by bundler:
gem 'cocoapods', :git => 'https://github.com/cocoapods/cocoapods', :branch => 'master', :ref => '42de87c'
Which is not needed anymore as 1.2.0.beta.3 has been released:
gem 'cocoapods', '~> 1.2.0.beta.3'
After updating Xcode to 8.2.1 , I was getting this error. Tried all the solutions above but didn't worked for me.
Finally the solution which worked was in the pod where this error was occurring, there was a folder named "Resources" which was somehow conflicting with Xcode. Changed that name to "XYZResources" , restarted Xcode then it worked.
Hope this helps.
Xcode 9, CocoaPods 1.3.1. Having the same issue with codesign for Alamofire library while the previous RxSwift library was signed without issues based on the logs.
Cleaning DerivedData helped. No need to deintegrate or clear CocoaPods caches.
Xcode build logs:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Intermediates.noindex/StockTrace.build/Debug/StockTrace.build/Script-0199EABB234BB41CBBA3ECF0.sh
cd /Volumes/DATA/work/StockTrace
/bin/sh -c /Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Intermediates.noindex/StockTrace.build/Debug/StockTrace.build/Script-0199EABB234BB41CBBA3ECF0.sh
mkdir -p /Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/StockTrace.app/Contents/Frameworks
rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/RxSwift/RxSwift.framework" "/Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/StockTrace.app/Contents/Frameworks"
building file list ... done
RxSwift.framework/
RxSwift.framework/Resources -> Versions/Current/Resources
RxSwift.framework/RxSwift -> Versions/Current/RxSwift
RxSwift.framework/Versions/
RxSwift.framework/Versions/Current -> A
RxSwift.framework/Versions/A/
RxSwift.framework/Versions/A/RxSwift
RxSwift.framework/Versions/A/Resources/
RxSwift.framework/Versions/A/Resources/Info.plist
sent 4091066 bytes received 106 bytes 8182344.00 bytes/sec
total size is 4090159 speedup is 1.00
Code Signing /Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/StockTrace.app/Contents/Frameworks/RxSwift.framework with Identity Mac Developer: <#identity#>
/usr/bin/codesign --force --sign <#id#> --preserve-metadata=identifier,entitlements '/Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/StockTrace.app/Contents/Frameworks/RxSwift.framework'
rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/Alamofire.framework" "/Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/StockTrace.app/Contents/Frameworks"
building file list ... done
Alamofire.framework/
Alamofire.framework/Alamofire -> Versions/Current/Alamofire
Alamofire.framework/Resources -> Versions/Current/Resources
Alamofire.framework/Versions/
Alamofire.framework/Versions/Current -> A
Alamofire.framework/Versions/A/
Alamofire.framework/Versions/A/Resources/
sent 306 bytes received 62 bytes 736.00 bytes/sec
total size is 53 speedup is 0.14
Code Signing /Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/StockTrace.app/Contents/Frameworks/Alamofire.framework with Identity Mac Developer: <#identity#>
/usr/bin/codesign --force --sign <#id#> --preserve-metadata=identifier,entitlements '/Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/StockTrace.app/Contents/Frameworks/Alamofire.framework'
/Users/<#username#>/Library/Developer/Xcode/DerivedData/StockTrace-dmkjlwtcrewkwofndddcdaqgntcv/Build/Products/Debug/StockTrace.app/Contents/Frameworks/Alamofire.framework: bundle format unrecognized, invalid, or unsuitable
Command /bin/sh failed with exit code 1
@bryan1anderson thanks so much for your kind help. my problem fixed by your solution
Most helpful comment
by deleting DerivedData folder contents really works, thanks @bryanboyko