Reputation: 731
I'm currently in the process of submitting my first app to the Apple store. I've completed the following processes
When I build the app it runs perfectly in the app simulator and on the actual ipad, however when I switch my app to Archive
on iOS Device i have a major code sign error which i've attached below.
codesign /Users/Gaby/Library/Developer/Xcode/DerivedData/RoyalAppInspection-dthvtpxadkslqmhkwdpaqkyujscg/Build/Products/Debug-iphoneos/RoyalAppInspection.app
cd /Users/Gaby/Desktop/RoyalAppInspection
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
/usr/bin/codesign --force --sign 79640A11C8D22589BD337496ABB8443581513846 --entitlements /Users/Gaby/Library/Developer/Xcode/DerivedData/RoyalAppInspection-dthvtpxadkslqmhkwdpaqkyujscg/Build/Intermediates/RoyalAppInspection.build/Debug-iphoneos/RoyalAppInspection.build/RoyalAppInspection.app.xcent /Users/Gaby/Library/Developer/Xcode/DerivedData/RoyalAppInspection-dthvtpxadkslqmhkwdpaqkyujscg/Build/Products/Debug-iphoneos/RoyalAppInspection.app
79640A11C8D22589BD337496ABB8443581513846: no identity found Command /usr/bin/codesign failed with exit code 1
I have no idea what to do to fix this, as I've tried to make sure all the other aspects of the process were completed correctly.
One concern i did have was when i clicked the provisioning profile file it would not open and "add to library" wouldn't pop up (i cannot access iphone configuration utility for some reason.) I manually added the .mobileprovision file to my xcode project but i'm thinking this may also be a source of my error.
Anyone, can you please help?
Upvotes: 60
Views: 147770
Reputation: 35412
Today, 2020 year, I've solved this problem with Xcode 11.7, Xcode 12.0 and Xcode 12.1 following these steps:
If it's messed up then the "When using this certificate" is set to "Always Trust" along with the blue +
Problem should have gone away. If that didn't work then go back to Keychain and just double check and see if there are any other Apple certificates that are set to Always Trust and repeat the process.
Upvotes: 0
Reputation: 57
Another reason you may see this error that I haven't seen posted yet, especially if you are using Jenkins, is that your certificate's private key needs "Allow all applications to access this item" selected.
Upvotes: 3
Reputation: 10898
I was having the issue after select the deny when it asks for permission
After some search I got it fixed by restarting the system.
Upvotes: 0
Reputation: 2741
I have Solved This Problem. If your project has .xcdatamodeld file (mean you are using coreData) then make sure the entities you formed go its Data Model Inspector and check Class has codegen, manual/None or classdefination. if it is class defination then make it manual/None and clean the project and run again. screenshots are given below:
Upvotes: 0
Reputation: 1755
I recently had this issue and all above solutions didn't work for me.
The reason why it works on your simulator but not real devices is probably related to your Development Certificate
.
So I revoked my certificate on Apple Developer Portal and request a new one on my computer. Here are the steps:
Then it works!
Hope it helps!
Upvotes: 0
Reputation: 281
This worked for me. Give it a try:
cd ~/Library/Developer/Xcode/DerivedData
xattr -rc .
Upvotes: 19
Reputation: 1740
I had this error in Xcode 8 and Mac OS Sierra. Tried all the above solutions and none worked. This was the only one that worked for me. Open terminal, and type this in:
cd ~/Library/Developer/Xcode/DerivedData
xattr -c *
Upvotes: 10
Reputation: 469
Open the project into the Xcode.
Select project.app
file and right click on it, select “show in finder” option.
Open terminal and go to the project.app
file path.
Type the following to commands one by one:
xattr -lr project.app
xattr -cr project.app
Open the project and run.
Upvotes: 2
Reputation: 11
Remove the existing precompiled files:
rm -rf /Users/raghu/Library/Developer/Xcode/DerivedData/Solitare-fdaukpanamlzllacxvdzfbeqcrsg/
And try to build it again.
Upvotes: 1
Reputation: 17
The easy way (which will do all png files) I used:
Run This Command in Terminal
find . -name "*.png" -exec xattr -c {} \;
Upvotes: -2
Reputation: 187
I have solved this problem, very easily.
I hope this helps..
Upvotes: 2
Reputation: 119
I Followed all the things mentioned in this thread but still facing same issue-
/usr/bin/codesign --force --sign A7F8FCD694D7923A3E57826398C3380E2E5A5446 --entitlements unknown error -1=ffffffffffffffff
Command /usr/bin/codesign failed with exit code 1
I have configured Automatic signing with my code base which will work with xcode run as well as xcodebuild run from terminal from my machine but it gives above error when I run it on jenkins pipeline or try to run on terminal from remotely connected machine
In my case Automatic signing is not working if access remotely. because I need to open keychain before archive using
security unlock-keychain -p "newpassword" "/Users/xyz/Library/Keychains/login.keychain"
keychain passwords & login password for macOS X user was different I change it to new same password and it works for me.
Upvotes: 2
Reputation: 13
Rebooting worked for me too. After upgrading to High Sierra I got tons of problems with password and it looks like I needed to enter the Password for the Keychain access to XCode.
Upvotes: 0
Reputation: 43
I had the same error on January 2018 with xcode 8.2.1
Before I try to open xcode I couldn't because the system was updating. I tried sometime later and it let me working on it, and then I got the same error.
I followed most of the solutions described in this article but they didn't work for me.
Then I remembered the message about the system updating and I tried to reboot the machine.
And that did the magic. It worked for me.
Upvotes: 0
Reputation: 6693
You almost made it on your own, but in the end there seems to be something wrong with your profile.
First I would recommend a tool to "look inside" the profile to make sure it's the right one: http://furbo.org/2013/11/02/a-quick-look-plug-in-for-provisioning/
This will just add some more information about the profile, when selecting it in Finder and pressing space (Quick Look).
Check your Xcode Preferences:
Xcode stores the profiles in ~/Library/MobileDevice/Provisioning Profiles
If your distribution profile is not in there, double click on it.
Then it should appear in that folder, but with a hashed name, e.g. 1edf8f42-fd1c-48a9-8938-754cdf6f7f41.mobileprovision
at this point the Quick Look plugin comes in handy :-)
Next, check your Project Settings:
Next, check your Scheme Settings:
Next, check the Keychain Access Trust
settings:
iPhone Distribution: Elena Carrasco (8HE2MJLM25)
on the rightApple Worldwide Developer Relations Certificate Authority
Next, check the Keychain Access private key Access Control
:
/usr/bin/codesign
) cmd + shift + g
to enter the path manually/usr/bin/productbuild
here as well (thx to DesignatedNerd)Hope one of this does trick for you!
Update (4/22/16):
I just found a very nice explanation about the whole code sign process (it's really worth reading): https://www.objc.io/issues/17-security/inside-code-signing/
Upvotes: 98
Reputation: 1744
The following steps solved the problem for me. I was having the issue where it was not compiling for the device or archiving, working fine for simulator.
Clean and build after doing the above steps and everything works fine now.
Upvotes: 106
Reputation: 200
In my situation, some pods were out of date after I updated my OS. Here's what fixed it:
In terminal:
cd /Users/quaisafzali/Desktop/AppFolder/Application/
pod install
Then, open your project in Xcode and Clean it (Cmd+Shift+K), then Build/Run.
This worked for me, hope it helps some of you!
Upvotes: 0
Reputation: 1
If nothing is working in @d4Rk solution Just use the below screen to delete unwanted/expired similar provision profiles. Right click on provision profile to move it to trash. provision profile window
Because in my case after doing all the steps I was still getting the same issue and it resolved when I deleted old expired provision profiles with same name and then using the correct one in build setting.
Upvotes: 0
Reputation: 1103
Just reset your development and distribution certificate and clean your project. After that , Reboot also worked for me. Interestingly it seems to be an issue with allowing Xcode access to the certificates. When i tried the archive again, i received 2 popups asking me if i wanted to allow Xcode to access my keychain. After this it worked fine.
Upvotes: 1
Reputation: 21398
For me following steps worked:
Xcode
.Terminal
.xattr -rc /Users/manabkumarmal/Desktop/Projects/MyProjectHome
Upvotes: 35
Reputation: 2773
For me, i just cleaned the app and it worked (cmd + shift + k), removing the error. I got the error after updating to swift 2.3.
Upvotes: 3
Reputation: 13
delete your certificate in your dev then Reinstall and it will working!
Upvotes: 0
Reputation: 687
Rebooting didn't work for me.
Just try with downloading and adding the Certificate again to keyChain. That worked for me. When I checked Keychain Access the respective certificate was missing. Got the problem solve when I reinstalled the certificate.
Upvotes: 0
Reputation: 17
Reboot also worked for me. Interestingly it seems to be an issue with allowing Xcode access to the certificates. When i tried the archive again, i received 2 popups asking me if i wanted to allow Xcode to access my keychain. After this it worked fine.
Upvotes: 1
Reputation: 5483
Do everything d4Rk suggests, that is a great walk-through. if it still isn't signing, you might have some expired or revoked certificates. I find this can happen when you're working on a team.
Upvotes: 2