Xamarin.iOS 15.6.0 does not support a deployment target of 15.4 for iOS (the maximum is 15.2)

Gary Rumble 1 Reputation point
2022-03-16T15:27:42.407+00:00

Windows 10, Visual Studio 2022, Mac mini running Monterey (12.3), Xcode up-to-date.

It was working, but now I get the error message in the title and can't proceed.

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

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 27,126 Reputation points Microsoft Vendor
    2022-03-18T06:15:23.947+00:00

    Hello,

    Try to go to Tools -> Options->Xamarin ->Apple Account in VS, remove your Apple ID and re-add it.

    When you pair to Mac, it may prompt Xamarin.iOS versions mismatch, the Xamarin.iOS SDK in your Mac is 15.4.0, but it is 15.6.0 in Windows. You need to install Xamarin.iOS 15.6.0 on Mac, then you could try to deploy the app to your device again. There may still be this warning("This request is forbidden for security reasons: Authentication Error. Xcode 7.3 or later is required to continue deploying with your Apple ID."), you can ignore it for now.

    You also could try to use VS for Mac, when you select Automatic Provisioning, the warning still exists, but it doesn't affect the deployment.
    In addition, we couldn't deploy by HotRestart.
    I will report this issue by my internal ways as soon as possible, thanks for your cooperation. If you have any other issues, feel free to let me know.

    ------UPDATE------
    This is a known problem and is being repaired by the product team.

    I found a workaround, you could try to use Manual provisioning and check the following steps:

    1. Delete your certificates and profiles: Go to %LOCALAPPDATA%\Xamarin\iOS\Provisioning\Profiles and %LOCALAPPDATA%\Xamarin\iOS\Provisioning\Certificates, delete them.
    2. Create Apple Development or iOS App Development Certificate: go to https://developer.apple.com/account/resources/certificates/add, select Apple Development or iOS App Development, it needs the CSR file in the Mac, you could refer to the Step 6-9 in this doc (https://learn.microsoft.com/en-us/xamarin/ios/deploy-test/app-distribution/app-store-distribution/?tabs=windows#creating-a-distribution-certificate), this doc is about creating Distribution Certificate, you need to create Apple Development or iOS App Development Certificate, then download it to your Mac and double click this certificate to install.
    3. Create an App ID : go to https://developer.apple.com/account/resources/identifiers/add/bundleId, select App IDs, fill in the information whose Bundle ID is same as the Bundle Identifier in info.plist, refer to https://learn.microsoft.com/en-us/xamarin/ios/deploy-test/app-distribution/app-store-distribution/?tabs=windows#creating-an-app-id. You also could create Wildcard App ID.
    4. Create development provisioning profile: refer to https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/manual-provisioning?tabs=windows#new-provisioning-profile, then download this profile and double click it.
    5. Export the developer certificate (p12 file) in Keychain of your Mac: go to Keychain, click Login, click Certificates on the top bar, then select the certificate which installed in step2, right click it and export as a p12 file, pay attention to remembering the password.
    6. Import the certificate and profile into VS: move the p12 file and the downloaded profile to your Windows computer, go to Tools -> Options->Xamarin ->Apple Account in VS, and click View Details, ignore the error message, click Import Certificate , import the p12 file and input the password. Then put the profile into %LOCALAPPDATA%\Xamarin\iOS\Provisioning\Profiles
    7. Select Manual provisioning and deploy the app to your device: connect your iPhone with your Mac, pair to Mac, select Manual Provisioning under iOS Bundle Signing, Signing Identity is your certificate, Provisioning Profile is your profile created in step2 and has been put in %LOCALAPPDATA%\Xamarin\iOS\Provisioning\Profiles . The Provisioning Profile may prompt No Matching profiles Found, you could ignore this message. Select your device under simulator list and run the app on your device.

    Note:go to Project->AppName.iOS Options -> iOS Build (Under Build Dropdown) -> enable device specific builds. If the run process hangs, try to check if it needs the password in Mac.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.