Xamarin Apple Account error: There was an error while loading your certificates: Object reference not set to an instance of an object

Jalza 781 Reputation points
2021-09-27T09:52:51.087+00:00

I'm trying to solve this problem that I have. Checking iOS configuration I realized that I have another problem with Apple Account certificates, I don't know if this problem is causing the first one. I'm using Visual Studio Professional 2019 Version 16.11.3 ​on Windows 10 Pro laptop. At this moment the iPhone is running iOS 15 and the Macbook has Xcode 13 and xamarin.ios SDK 15.0.0.6 (downloaded from here) installed.

In Visual Studio, I follow these steps:

  • Go to Tools > Options > Xamarin > Apple Accounts.
  • Select the team.
  • Press the "View Details..." button.

I get this error while certificates and provisioning profiles are loading:

There was an error while loading your certificates: Object reference not set to an instance of an object.

135430-certificates-error.png

Then, the provisioning profiles are loaded successfully.

If I try to create a certificate pressing Create Certificate > iOS Development button, I get the same error.

All certificates are installed in the Macbook dragging files to Keychain.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,371 questions
0 comments No comments
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 34,556 Reputation points Microsoft Vendor
    2021-09-28T06:54:28.443+00:00

    Hello,
    Welcome to our Microsoft Q&A platform!

    First, I'm afraid you could create a demo project with Xcode13 and running on your device so that I can determine if the problem is about VS , you can refer to the following steps:

    • create a new project with Xcode
    • connect your device with your mac var USB
    • In your Mac, go to ~/Library/MobileDevice/Provisioning Profiles , delete the profiles you don't need to use. (If you don't have other project, you can delete all )
    • select Automatically Manage sigining to deploy the app to your device (don't use Personal Team, make sure Profile is correct)

    If you can't depoly this demo to your device, you can share the error message or connect to Apple support, there are something wrong with your developer account.

    135719-image.png
    135779-image.png

    Second, if you can deploy app to your device, you could connect your device with mac and Pair to Mac by VS(Windows PC) again , try to deploy another demo to your device by Automatic Provisioning.

    Third, if you still can't deploy, you need try to use Manual Provisioning. Login in Appledeveloper portal, then you can refer to the following steps:

    • Regist a new identifier
    • Register a New Provisioning Profile(choose iOS App Development)
    • Select Type ->Configure->Generate- >Download(when you select certificates, you need make sure this cer is in your KeyChain. If you are not sure, you can create a new cer, this need a CSR file in your mac)

    You could donwoload the profile and use Xcode to deploy app to your device, if you can deploy , it verify this certificate is correct.
    135756-image.png

    Then, you could clean VS , pair to mac, and use the same Boundle Identifier(in infor.plist), deploy app to your device by Manual Provisioning.

    -------UPDATE---------
    You could use Hot Restart to deploy app to your phone when you connected to PC, VS for Mac have been released with stable versions of iOS15 and support for Xcode 13 , you also could use VS for Mac.

    Best Regards,
    Wenyan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Sascha Ingenohl 1 Reputation point
    2021-10-06T19:22:26.06+00:00

    I've the same problem. If i want to load the certificated the same error is coming. There was an error while loading your certificates: Object reference not set to an instance of an object. I've have two "teams" connected. This happens only one one Team. On the other team it is working.
    So is there a solution?`

    0 comments No comments

  2. Dacia Turner 1 Reputation point
    2021-10-11T20:43:34.567+00:00

    I've been searching for a solution to this since I upgraded my iPhone to iOS 15 too. When trying to use Hot Restart to debug the app, I get an error stating "xamarin.ios does not support running or debugging the previous built version of your app...". If I check into the View Details of my Apple account Agent profile, I get the error stating "There was an error while loading your certificates. Object reference not set to an instance of an object."

    I had no trouble debugging on my iPhone prior to the iOS 15 upgrade so any help would be greatly appreciated.

    0 comments No comments

  3. Andrew Hoke 1 Reputation point
    2021-10-25T18:26:32.283+00:00

    Still seeing this issue even after updating to VIsual Studio 16.11.5 which has support for Xcode 13 and iOS 15. I have a distribution certificate expiring soon and I can't refresh my certificates on my Windows dev machine because of this issue.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.