code sign error in xcode, no identity found

2020-03-01 03:47发布

问题:

I've looked to solve this problem for several hours now, so hopefully someone can help me.

When I try to Archive my project (so I can put it in the app market), I get a code sign error:

Codesign failed with exit code 1

and some additional information says

iPhone Distribution: company name: no identity found

I've created a distribution profile (multiple times) and followed several suggestions (like uninstalling/installing Xcode). Also my distribution profile expiration date is February 2014.

I can Build my project without any problems and run it on an iPhone with my iPhone Developer profile.

Does anyone knows what I'm doing wrong here? Any help would be appreciated.

回答1:

Your Distribution Profile might not be valid or not properly verified, go to Organizer->Devices->Provisioning Profiles and try to refresh your profiles(delete & refresh) they will show up after refreshing. Once refreshed, make sure the green icon as status is showing with the profiles if it is valid and signed properly. if it does not solve your problem then you need to create the Distribution profile again. You could find this tutorial helpful if you are getting started with distribution of your app. I hope it helps your cause



回答2:

I have the same issue, the reason is after I run other project and fix the issue with the other project.

My solution is :

Xcode -> Proferences -> Choose Apple IDs -> Choose Team -> View Details -> Signing Identities iOS Development and iOS Distribution reset.

Then Run project to iphone it works fine.



回答3:

i am not sure why my solution worked, but after hours of trying everything else... i changed code signing settings in both project and target windows. code settings under 'project' shows my provisioning profile (photo below), code settings under 'target' is now set to 'automatic'. maybe before i had conflicting settings?



回答4:

I've got the similar error and found the reason that my certificate in keychain was not the one that I attached to the provisioning file in apple developer portal. Because there were two certificates with same name and I downloaded the wrong one. Upon downloading the correct certificate and double clicking to put into keychain solved the problem.



回答5:

I have been in contact with apple and after a few emails back and forth they found my problem. For some reason (I don't know how this got there) in the Build Settings under Code Signing -> Other Code Signing Flags I had "--keychain keychainname.keychain" written down there. After I removed this my code sign error dissapeared.

Every body thanks for the help.



回答6:

The problem is you need to create/update a provisioning profile for you new device. Provisioning profiles are associated with devices, once you set that up correctly, you should be good to go



回答7:

I didnt have proper developer/distribution certificate in my keychain. When i installed it to my keychain, issue disappeared!



标签: ios iphone xcode