'Can't deploy Xamarin app to IOS device (Provisioning Profile: Missing Private Key)
I've paired to my Mac with Xcode version 13.3
I've renewed my Apple Development Membership (Individual) and got a < new Team ID >.
In Visual Studio 2022 (Windows) I can re-attach my Apple Account.
It shows < my name>
Role: Agent
Press: View Details...
It says: "There was an error while loading your certificates: This request if forbidden for security reasons: Authentication Error. Xcode 7.3 or later is required to continue developing with your Apple ID"
Comment: I just signed in with same credentials as for my Apple ID. Don't understand.
Press: OK
It says: ".... An active membership to the Apple Developer Program is required to provision iOS devices for development..."
Comment: I've an active membership and that is the one I try to sign in with.
In Visual Studio, iOS project properties, iOS Bundle Signing
Select: Automatic Provisioning
Select Team: < my name> - Individual - < new Team ID> (< my email>)
It says: "This request is forbidden for security reasons: Authentication Error. ...."
Comment: I just signed in with same credentials as for my Apple ID. Don't understand.
Certificates:
Certificate Name:
Issued To: iPhone Developer: < my name> (< old Team ID>)
Identifier:
- Bundle ID: com.< company>.*
- App ID Prefix: < new Team ID>
- Platform: iOS, macOS, tvOS, watchOS
Provisioning Profile:
- Type: Development
- Expires: 2023/04/11
- App ID : < new Team ID>.com.< company>.*
- Certificate: < my name> (iOS Development)
On my Mac.
In Keychain Access, I can see my certificate:
Issued To: iPhone Developer: < my name> (< old Team ID>)
It has no private key
In Xcode:
iOS Development Certificates
Creator: < my name>
Status: Missing Private Key
If missing private key is the issue, how do I add one?
If not , what can be the issue?
Solution 1:[1]
The link in Jason's comment above is the answer: its broken, and Microsoft are taking a very long time to fix it. I have the same issue, and am worried that Apple's new policy of delisting apps that haven't been updated in a while might cause my app to be delisted, as I cannot update it until this is fixed.
Solution 2:[2]
The thread contains a possible workaround that might work for you, beyond that it's on the account of Microsoft.
On your Mac in XCode, ensure your certificates and profiles are downloaded (Xcode->Preferences->Accounts)
On your Mac in Keychain Access, export your development certificate and provide a password for the p12 file (KeychainAccess/My Certificates, File->Export Items), copy the p12 to the PC Desktop 2 On your Mac in Finder, Go->Go to Folder->~/Library/MobileDevice/Provisioning Profiles, copy all .mobileprovision files to your PC into %HOME%\AppData\Local\Xamarin\iOS\Provisioning\Profiles
On your PC, open Visual Studio and then Tools->Options->Xamarin->Apple Accounts, click the account and also the name in the box below
Click “View Details” and wait for the spinners to throw the now-familiar errors
Click “Import Certificate”, choose the certificate you copied in step 1, and enter the password you chose
More errors will be thrown, but the certificate will have been imported into %HOME%\AppData\Local\Xamarin\iOS\Provisioning\Certificates
Close and reopen VS or at least the VS solution (might be unnecessary but hey)
In your VS iOS project, click Properties and you should now be able to select the new certificate and the desired profile
Build and run on the provisioned device(s).
The issue is caused through Visual Studio not following up with updates on the Apple Developer API as of XCode 13.3.
You can bypass this by manually adding the profiles/certificates onto your windows machine.
As for me it was actually enough to just manually create the profiles through the portal and downloading them into the said directory.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | ControlAV |
Solution 2 |