1

I am trying to deploy my app on an iPhone 11 for testing, but I am getting an error telling me that it cannot automatically provision the project. I am currently using MAUI but the same error happens when I try and deploy a Xamarin app to iOS (in stable VS 2022).

I have bought a developer membership for 99/year. I have installed the latest XCode on the MacOS machine My Visual Studio 2022 Preview is connected to the Mac, all my devices and IDE are connected to the developer Apple account. It detects the iPhone as a valid target but does not want to provision the project.

Is there some crucial configuration that I missed somewhere?

The error happening when I try to select a team

YaRmgl
  • 356
  • 1
  • 6
  • 19
  • I think this functionality might be bugged right now due to changes on the Apple side of things. You might want to check in your Visual Studio through the Help menu, Provide Feedback, Report an Issue and see if an issue has been reported already – Gerald Versluis May 19 '22 at 08:21
  • yeah I have create a bug report, I will also try to contact apple support – YaRmgl May 19 '22 at 09:35
  • Not apple support - IMHO, VS needs a fix, to match what Apple XCode is doing now. If you attach the iPhone to the *Mac*, can you get it provisioned there? Follow steps in first half of https://stackoverflow.com/a/60327393/199364 (though I haven't tested with latest Xcode and VS Mac). Once that works, you *might* be able to attach device to PC, and run Automatic provisioning there. – ToolmakerSteve May 19 '22 at 20:57
  • 1
    @ToolmakerSteve I can deploy a swift project to the iPhone, but not a xamarin or MAUI one – YaRmgl May 20 '22 at 03:12
  • It's a known issue here : https://developercommunity.visualstudio.com/t/Cannot-load-Apple-certificates/1692185?viewtype=all, you can try to switch to `Manual Provisioning` or try the solutions/workarounds in the link . – ColeX May 23 '22 at 08:26
  • @ColeX-MSFT Manual provisioning also does not work, it does not detect any valid configuations – YaRmgl May 23 '22 at 12:29
  • It seems like a potential issue, consider raising the issue on [github](https://github.com/dotnet/maui/issues) for better support . – ColeX May 24 '22 at 06:11

2 Answers2

3

1-in Visual Studio press tools tab then select Apple Accounts

2-Remove any previous added accounts

3-Press on Add button, select Individual Account

4-Will ask you to fill Api Key fields.

To generate an API key to use with the App Store Connect API, log in to App Store Connect .

Select Users and Access, and then select the API Keys tab.

Click Generate API Key or the Add (+) button.

Enter a name for the key. The name is for your reference only and is not part of the key itself.

Under Access, select the role for the key.

Click Generate.

Then continue with Hot Restart to automatically provision the project.

1

Like @Gerald Versluis said, there is a problem on the Apple side.

Until they fix this you have to use the mac as the display. In VS goto /Tools/Options/Xamarin/iOS Settings and disable "remote simulator to Windows".

The simulator will be started on the Mac, but even hotreload is working.

FZelle
  • 19
  • 1