Command /bin/sh failed with exit code 1 and Embedded pods framework - ios

Not able to identified actual issue, During updating coco pod getting a message "Re-creating CocoaPods due to major version update."
(that was come only once) and pod updation is successful. After on build i am getting the error. Command /bin/sh failed with exit code 1.
Below is some detail also which i am getting
Code Signing /Users/Gaurav/Library/Developer/Xcode/DerivedData/Appname-******/Build/Products/Debug-iphoneos/Appname.app/Frameworks/Alamofire.framework with Identity iPhone Developer: Account Name (Account Id)
/usr/bin/codesign --force --sign ***************** --preserve-metadata=identifier,entitlements "/Users/UserName/Library/Developer/Xcode/DerivedData/Appname-***************/Build/Products/Debug-iphoneos/Appname.app/Frameworks/Alamofire.framework"
/Users/Username/Library/Developer/Xcode/DerivedData/Appname-************/Build/Products/Debug-iphoneos/Appname.app/Frameworks/Alamofire.framework: bundle format unrecognized, invalid, or unsuitable
I'm using iOS 8 as deployment target and Xcode 7.3.1
I have checked code signing identity that doesn't have any issue. I have reinstall again all pod and Alamofire also but not abel to identified issue.

Clean the project, and deleting the derived data (~/Library/Developer/Xcode/DerivedData/) fixed it for me

If it was complaining about a particular Pod and being unable to codesign it.
Below things work for me:
Select the Pods Project In the main editor window, select the Pod in
the targets dropdown
Under the general tab, and under the identity header, click choose
Info.plist file
Select the plist file for the Pod
The project should now build. For some reason, it seems to lose this setting, or not be able to reference it's own plist file.
Not 100% sure but I hope it helps someone.

I have the same issue. It happen after updating cocoaPods, so I just downgrading it and all works fine. I think we just need to wait for a new version of cocoaPods and for now you can use old version.
How to downgrade cocoaPods

Related

Can't archive with Xcode (error - PhaseScriptExecution failed with a non zero exit code), but the build is successful

I am sorry for the black marks in the image.
I have seen multiple posts suggesting an answer to this problem, Lock unlocks keychain (tried it), pod Update (tried it), clear build(tried it), signing, skip install in build settings(tried it) - None of them actually worked.
I built my iOS app in react native with Expo, after which I did expo eject to create the iOS folder for Xcode build and archiving, the build is successful every time and it even runs on the simulator and in my device(iPhone 7) but it always failed to archive by throwing this error - Uncategorised - Command PhaseScriptExecution failed with a non zero exit code..
Any help to point me in which direction should I go or what can be the possible mistake that I am doing will be of great help. Do let me know if, I should provide any more detail about this. Thank you!
Xcode Version - 11.0
Mac Version - 10.15 Catalina
iPhone OS - 13.1.3
Few links I tried from -
"${PODS_ROOT}/SwiftLint/swiftlint" causes "Command PhaseScriptExecution failed with a nonzero exit code" with Xcode 10
https://github.com/apollographql/apollo-ios/issues/395
https://www.reddit.com/r/iOSProgramming/comments/al9box/getting_an_error_command_phasescriptexecution/
Make sure you have installed your pods correctly. For me I removed all the pods from my pod file, updated the pod through the terminal, then re-added the pods to the pod file and installed through the terminal. This worked perfectly for me.
I had the same exact problem. What worked for me was I opened the podifle and deleted all the pods, then saved it. After that run pod update in terminal. Go back to the podfile and past the pods back into the file and save it. Then run pod update in terminal again. After that open xcode and run the cleaner and then try to Archive...it worked for me.
Based on the previous answers, the following worked for me:
Quit XCode.
Delete all relevant files: Podfile, Podfile.lok, Pods folder and .workspace file.
Recreate the Podfile and open the new .workspace file.
Cheers
PS: In my case, I hit this issue after copying an existing project (workspace) to a new machine.
Try go to accounts and press download manual profilesenter image description here

framework not found RealmSwift

I was installing Realm and imported to my project but when I run the app it shows me an error:
ld: framework not found RealmSwift
clang: error: linker command failed with exit code 1 (use -v to see invocation)
There can be multiple reasons for this issue.
To get the exact issue you can follow the below step :
Right click on error and select 'Reveal in log'. This will give you more insight about the reason of error.
One of the solution is to setting the 'Enabled Bitcode' to No. For this go to Build settings in your target and search 'Bitcode' in the search field.
I have faced this issue multiple times and one of the below solution may work for you.
After installing the pods make sure that you're opening the workspace instead of Xcode project file.
Restart Xcode
Remove derive data for your application
Reintegrate pods using pod deintegrate and pod install for your project
Reset simulator(If you are viewing the output in simulator)
Ensure proper linking of Framework in your project
Restart simulator
Clean project etc.
Hope this may help you.
I was having the same issue.
Initially, I was trying to import the files (Realm.framework and RealmSwift.framework) from download folder but then i was getting the same error like yours.
What i did then, i copied the folder containing the (Realm.framework and RealmSwift.framework) into the project folder and then i imported the files from there. That resolves my issue.
In my case, I've updated the Cocopods to the latest version (1.1.0) via this command sudo gem install cocoapods
is it possible that you are still running the .xcodeproj file. You should run .workspace file in your xcdoe

Command /bin/sh failed with exit code 1 Xcode 9.1

When i am run project in Xcode then showing some error that means my add pod file is unknown error
and
error screen short
Screen Short Link
and showing error text is
"/Users/Appsfactor/Library/Developer/Xcode/DerivedData/You_Task-hfbipjtwskuqvfgdnnjienomkrbm/Build/Intermediates.noindex/ArchiveIntermediates/You Task/InstallationBuildProductsLocation/Applications//You Task.app/Frameworks/ALCameraViewController.framework: unknown error -1=ffffffffffffffff
Command /bin/sh failed with exit code 1"
Try deleting your Keychain certificates pertaining your current project and rebuild using new certificates from developer.apple.com and try. Worked for me.
Clear Derived Data
Empty your Trash
Clean your Xcode Project and Run again.
Worked for me.
Just update your Pods or re - install the same.
Clear Derived Data
It'll work
Clear Derived Data
restart system
after open Xcode and run, it will work

Xcode 8.3 Archive error: Linker command failed with exit code 1

I started getting this error only after upgrading from Xcode 8.2 to Xcode 8.3, and only when making an archive build (debug builds work fine).
When I do the archive via Xcode, the only message I get is "Linker command failed with exit code 1 (use -v to see invocation).
I build with the command line xcodebuild -scheme MyProduct
When I built this way, I found a number of issues (again, only when doing Archive):
I had to add import UIKit to practically every swift file.
all the pods had issues
remove everything from app-Bridging-Header.h
add a few things back into app-Bridging-Header.h
My current issue is with the AWS pod, using version 2.5.3
So my app-Bridging-Header.h has #import <AWSS3/AWSS3.h>
Here is the error from the command line build:
error: 'AWSS3/AWSS3.h' file not found with <angled> include; use "quotes" instead
#import <AWSS3/AWSS3.h>
^
The error log continues after that. I also tried the crazy suggestion of switch in the import to "AWSS3/AWSS3.h"...that didn't work either.
What is going on?
More INFO
This really appears to be an issue with one of my pods. I built a new solution, imported a subset of my pods and everything built. Then when I updated with the full list of pods it broke.
For me it is coming due to Bitcode enable in my project and i have used a custom framework with disabled bitcode.
Two things you can do :
Either disable bitcode in your project
OR
Build framework with bitcode enable
NOTE: If you click on error and it doesn't show anything then right click on error and select Reveal in Log. You will get error for this issue
At long last I was able to figure out this was a pod issue...just had to figure out which one it was.
I created a brand new project and started adding my pods in one by one (actually, 3 by 3...one by one would have taken too long).
Conclusion: localytics 4.3.1 has a bug in it somewhere. I downgraded to 4.3.0 and the problem went away.
I got a problem like this. My suggestion is that you should remove the version of 8.3 and download any old version from this link: https://developer.apple.com/download/more/
I hope that it will work.

iOS: Codesign error: bundle format unrecognized, invalid, or unsuitable in subcomponent Base.lproj

I have a project that was building just fine. Seemingly randomly, doing a Run one time resulted in a codesign error that I've been unable to resolve for 2 days.
The error reads:
bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/user/Library/Developer/Xcode/DerivedData/.../Base.lproj
I'm not sure why this error sprung up. It may have happened after I selected a 'Team' in Xcode - but I can't remember (and I don't know why that would cause an issue). I tried cleaning up my Keychain, creating the bundle identifier in my developer account, a handful of Terminal commands from other posts, to no avail.
What's odd to me is that it seems to indicate it has something to do with Base.lproj - which holds only the LaunchScreen nib and my Main.storyboard. Could there be something in Storyboard that is causing a codesign issue? Something else? SOS.
This is a big stab in the dark, but I got this error when I added a directory named "resources". Removing it fixed the issue for me.
I ran into the same issue with Xcode 7.3.1 and cocoapods. I ended up doing the following:
1.Closed Xcode
2.Removed everything under my DerivedData folder
rm -fr /Users/{user}/Library/Developer/Xcode/DerivedData/*
3.Restarted Xcode and rebuilt the project
I got this error when I added the script fixing a keychain error -34018 which first had appeared in XCode 6.3.
#!/bin/sh
codesign --verify --force --sign "$CODE_SIGN_IDENTITY"
"$CODESIGNING_FOLDER_PATH"
If you are using CocoaPods, then update CocoaPods and then all the pods worked from me.
sudo gem update cocoapods followed by pod install

Resources