How to repair Xcode 11 managed profiles? - xcode

My distribution certificate was due to expire soon, so I went ahead and created a new one and revoked the soon to be expired.
I noticed that Xcode was not recreating the provisioning profiles automatically, when clicking on the info button besides the Provisioning Profile Xcode Managed Profile I saw a provisioning profile created with the last certificate even though it was already revoked.
I tried signing out and in to my developer account in Xcode preferences.
I tried deleting all provisioning profiles on my apple developer account.
I tried deselecting and reselecting the Automatically manage signing checkbox on the target.
All of the above did not worked.

The only thing that worked was to add a new app capability. I added a new group identifier to the App Groups capability, waited for the repair message and then removed it again.
Hope this helps.

Related

Xcode 8: Your account does not have sufficient permissions to modify containers

I'm getting this error with code signing with Xcode 8:
Your account does not have sufficient permissions to modify containers
What does it want from me?
I also faced this issue in XCode 8.3.3 (8E3004b). I just went to Project Settings → Capabilities tab, then toggled iCloud off and on. Once I went back to the General tab, the errors were gone.
This seems like it may be a bug with XCode 8.
To resolve this, I unchecked the "automatically manage signing" checkbox in the of my target's General settings. I then archived my project by manually setting the provisioning profiles. After that succeeded, I went back and again checked the "automatically manage signing" checkbox and it stopped complaining with errors that made no sense.
Just had this issue with XCode 8.3.2 after we enabled iCloud Capabilities and the entitlements changed. We use automatic signing - xcode managed profile. Going into Xcode -> Preferences -> Download All Profiles wouldn't fix the problem UNTIL we temporarily made team members Admin and repeated the process. At that point XCode realized the new provisioning profile and the problem was solved.
Just goto Xcode capabilities section and see if any of the capability showing error then disable that and enable again. Then come to your Signing section in General. The issues will go now
1) Remove all automatically created provision profiles from
~/Library/MobileDevice/Provisioning Profiles/
2) In Xcode 11.1 and higher remove and add capabilities
I faced this issue in XCODE Version 8.3.3 (8E3004b). To resolve this go to project settings. In capabilities tab -> iCloud -> containers. Verify whether valid iCloud containers are selected and you have permission to access these containers. This should resolve the issue.
I was having the same problem too after I added a new device with Xcode 8.3.3 (same issue present in Xcode beta 9.0 as well). My Apple Developer account wasn't an administrator at the time either. I tried deleting my provisioning profiles and re-downloading them but that didn't work. I tried manually downloading and installing the provisioning profiles from developer.apple.com, but that didn't work either. I had my Apple Developer account made an Administrator following advice from dchappelle https://stackoverflow.com/a/43812123/5760384 and voila! The provisioning errors went away. (I'd reply to his post, but I don't have enough reputation.)
Full text of error:
Your account does not have sufficient permissions to modify
containers. Provisioning profile "myApp" doesn't include the currently
selected device "myDevice". Code signing is required for product type
'Application' in SDK 10.3
Another potential solution, depending on your needs, is to upgrade to the paid version of the Apple Developer Program; this gives you access to the iCloud container features. Once paid and activated (the membership application takes a few hours to go through if you're an individual... sometimes a few days if you're a business) you'll need to enable iCloud features via the online dashboard or via XCode as per Apple's instructions. You may then have to restart XCode.
I had the same issue with Xcode 9.2. But in my case, the problem was in Keychain: my dev certificate was saved into login keychain by default. I was able to build an app on a device only when I moved it to System keychain.
So the steps are next:
Open Keychain Access
Open login keychain (you can see the list of all keychains on the left top corner of the window)
Drag and drop your dev/distribution certificate into System keychain
You may need to input password.
PS: while doing this steps you also may need to unlock locks on the keychains.
I had this problem and I fixed it by logging in to the iTunes development portal and accepted the new Terms & Conditions. I was basically locked out until these were accepted.
I was getting this error because I was in another team (my university team account), which was severely limiting my access to developer.apple.com features. Once I left that team (I added an answers here because even this was a bit of a pain), I was able to remove & re-add my account to XCode. It then worked.
EDIT: It happened again on a new machine (an M1 mac), and this time I had left the university account. By removing and adding back "Apple Pay" capability in Signing & Capabilities, it immediately fixed itself.
None of the other answers worked for me. E.g. The app doesn't even use iCloud, and enabling-disabling it didn't help. Deleting profiles, revoking certificates, disabling/re-enabling automatically manage signing also didn't help.
Go to Xcode -> preferences -> Accounts.
Remove your Apple ID & login back. Refresh the signing in on your project target
I had the same issue using Xcode 9.3
Solution:
1 - Deselect "Automatic manage signing"
2 - Created a Provisioning profile for dev and dist and added in Keychain.
3 - Again when you come back to Sighing (debug and release) you can see your created provisioning profile in a dropdown
4 - Crate archive by selecting "Generic iOS devices" in the project schema

How do I regenerate Xcode managed provisioning profiles?

I see a bunch of "Invalid (Managed by Xcode)" development provisioning profiles in the Apple Developer Center.
How do I regenerate them so they become green? (i.e. "Active (Managed by Xcode)")
When I try tapping on an active one, I have the following options:
Delete
Download
When I try tapping on an invalid one, I have the following options:
Delete
I don't know exactly what forces a refresh, but in the past, these things seemed to help:
Deleting all provisioning profiles in Xcode and pressing the Download All button regenerated the profiles (e.g. As a member, I pressed the Create button to create the development certificate, then pressing the Download All button added the newly created certificate to the managed profile.)
Adding a new device via the online portal seemed to regenerate the managed profiles to include the newly added device.
Pressing the Fix Issue button in Xcode in the target settings.
Try building to device and press the Fix Issue button when Xcode presents that option.
Sometimes you'll get in a state where everything gets regenerated except for the one with the app id you really need. The provisioning profile doesn't show up in Xcode, and no matter what you do, it stays stuck in the invalid state.
WARNING: The following may be very hard to undo, so do so at your own risk!
In that case, you could try deleting the provisioning profile on the Apple Developer Center and hope that the Fix Issue button in Xcode will regenerate it. I've seen it work before, but in some cases, I've seen it give this error with no means of recovery:
An App ID with Identifier 'com.example' is not available. Please enter a different string.
This may seem like you're in an even more unrecoverable situation, but I was able to regenerate it at least once by launching Xcode Beta 8 and tapping the Fix Issue button. It seems that they fixed some bugs with the Fix Issue button in the latest Xcode.
(Note: Sure you could try to delete the offending App ID and then press the Fix Issue button, but you'll invalidate all the important provisioning profiles on your account.)
If you still run in to issues, make sure that you're following these best practices.
If you run into code signing issues:
Make sure the development certificate has been downloaded.
Delete all invalid certificates from KeyChain.
Delete all provisioning profiles from your machine.
Download All the latest profiles.

Provisioning Profile, Certificate is not listing in xcode 6.2

When I click on Code Signing Identity or Provisioning Profile, It gives me popup that says to enter value..
Check above Image, How to solve this???
Is it bug in xcode 6.2?
Bellow is account which has provisioning profile...
I have tried following things..
2 time restared mac
3 time restared xcode
tried on xcode 6.2 and 5.1
EDIT
I have tried Following all things.
Refreshing Account
Removed Account from Preference, Restart Xcode, Add Account again
Removed All Certificates, Provisioning profile from Keychain Access, Removed Account from xcode, Removed All Certificates from portal. Recreated Certificates and Provisioning profile, Downloaded it again
Removed All Certificates, Provisioning profile from Keychain Access, Removed Account from xcode, Removed All Certificates from portal. Recreated Certificates and Provisioning profile, Downloaded it again
I have Team Member Developer Account..
If I am missing anything to add here let me know..
Adding your Profile by typing "iPhone Developer" does not make sense.
Do the following steps:
go to the Apple Member Center and download all certificates and provisioning profiles
save them somewhere you can access theme like on desktop
double-click all of them, certificates and profiles
this will bring up Xcode and the Keychain
close Keychain as you won't need it anymore
in Xcode, go to Build Settings to verify the profiles were added correctly
set the Developer Code Signing Identity to your profile
Everything should work now.
Hope that helps :)
You must open the provisioning profile with xCode to be able to see it in the menu. Also, be sure that your Developer certificate's are in your keychain. If nothing else, try revoking them in your portal and recreate them.
Follow these steps :-
Xcode -> Preferences -> Accounts -> click on your Apple ID -> Click View Details -> click on your projects Provisioning Profile -> click the refresh button bottom left.

App profile needs to be renewed?

I just clicked on Organiser in XCode (I'm running latest publicly available version), and I noticed on one of my apps profiles it says "renew" so I click on that and I get an error msg, saying..
The given profile was not found on the provisioning portal.
Please refresh your provisioning profiles before attempting to renew
“AppProfile"
I don't understand any of that. So...
1) What is it asking me to renew? a development profile? do I need to renew developer profiles? what happens if I don't?
2) Why am I getting an error? what does it mean by "refresh my provisioning profiles" ?
3) Do I have to do this (whatever this is and however I have to fix it) for all profiles? development and distribution?
well i dont know if you have found an answer or not but here is my answer.
you need a valid developer and also distribution profile ( i am sure you are aware of this already) to upload your app. if your app is uploaded and is in the app store you still have maintain a valid developer profile in order for your app to stay in the app store. otherwise they will bring it down.
the fact that it asks you to refresh your developer profile is related to the new system of developer profiles that all of a sudden got introduced. there is no need of renewing your profiles every 3 months anymore. your profiles are good for a year. you have to go to organizer in xcode and select all the profiles you have in there. delete them and then go to your team or your own name on the right pane and there you find the refresh button down at the bottom of the window. when you use that it resyncs your profiles with the developer site.
yes you may have to do that for all of your profiles if you have not done that in past three months.
i hope you find my answer useful.
Edit:
Just go to the developers site and revoke the ones that are about to expire or already expired. Then remove them from keychain and xcode also. Then in keychain create a new certificate request and on the Dev site create new profiles. After creating the new ones download them so they can synch with keychain. After that go the organizer and refresh. Xcode will synch with developer site and will download the new ones. Make sure you connect your test devices so the new profiles can be updated as well. That should do the trick.

MAS: Code Signing Identity Private Key

I've removed all development and installer certificates from the development portal, created a new CSR and generated new Application and Installer certificates.
Now I'm about to distribute the App to the MAS and am constantly presented with this error:
"Name" is a valid identity. However, the private key for the associated package
identity "Name" is not installed on this Mac.
Developer Profiles from a different Mac can be imported.
This puzzles me, since the private key is on the System, how else could I've generated the certificates without them?
Double check you have removed all old certs, there is a menu item in the KeyChain app to show all expired certs. I threw away all expired certs and things started working.
Got it working:
Created a new user account on my Mac
Cloned the repo there
Removed all Provisioning Profiles and Certificates from the Dev Portal
Let Xcode generate all the Certificates for you
Upload works!
The problem is Mac Installer Distribution certificate.
The easiest way to have everything fixed and loose all the troubles just go to Xcode->Window->Organizer->Devices and then on the lower right corner press on Refresh and log in with your account... xcode will generate and download all the certificates and provisioning profiles needed.
I followed the instructions and deleted all expired certificates from the keychain and refreshed the profiles list within the organizer. How ever the error only vanished after I restarted Xcode.

Resources