mauicode-signingprovisioning-profilemac-catalystapple-developer

Cannot find provisioning profile for Mac Catalyst App


I'm using JetBrains Rider to do .NET MAUI development on macOS Sonoma (14.6.1) as VS Code is broken for me.

My goal is to complete a Mac App test of a multi-platform app I've been working on. It successfully builds and launches in iOS and Android simulators/emulators and works on my test iPhone and Android phone. However, it will not launch as a Mac catalyst app. Every time I get an error that Xamarin.Shared.targets(1834,3): cannot find any available provisioning profiles for the app. I've gone through the provisioning process, deleting and remaking the Certificates, App ID, and Profiles in my developer dashboard. I made one for macOS and one for iOS with Mac enabled as well. I've downloaded, installed, uninstalled, and redownloaded and installed. I'm not sure what I'm missing and .NET MAUI's documentation for this is very poor. Happy to share my csproj code below to get some help and provide logs or screenshots as needed. I checked Xcode and there's three signing certificates there as well.

Here's the relevant portions of CSProj:

<!-- Debug Configuration for iOS -->
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)' == 'Debug|net9.0-ios'">
    <CodesignKey>key is here</CodesignKey>
    <CodesignProvision>Automatic</CodesignProvision>
    <BuildIpa>true</BuildIpa>
</PropertyGroup>

<!-- Release Configuration for iOS -->
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)' == 'Release|net9.0-ios'">
    <CodesignKey>key is here</CodesignKey>
    <CodesignProvision>Automatic</CodesignProvision>
    <BuildIpa>true</BuildIpa>
</PropertyGroup>

<!-- Debug Configuration for Mac Catalyst -->
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)' == 'Debug|net9.0-maccatalyst'">
    <CodesignKey>key is here</CodesignKey>
    <CodesignProvision>Automatic</CodesignProvision>
</PropertyGroup>

<!-- Release Configuration for Mac Catalyst -->
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)' == 'Release|net9.0-maccatalyst'">
    <CodesignKey>key is here</CodesignKey>
    <CodesignProvision>Automatic</CodesignProvision>
</PropertyGroup>

Solution

  • So a few more hours and I figured out what I needed to do to get it up and running. For those who need to get this working, there's a number of detailed steps that I will mention here but more details are actually found in the documentation, albeit if you are newer to this kind of thing like me, you may not find the wording of the title confusing: enter link description here

    In summary:

    1. On your Mac create a certificate signing request through Keychain.
    2. Then create a development certificate in your Apple developer profile (choose Apple development) and upload the certificate you saved to disk in the previous step.
    3. Then download that certificate and open it. It will save to your Keychain Access. You'll need the name later for the CodesignKey property in your csproj file.
    4. Next create an App ID. Key things--use reverse domain (com.domainname.appname). Choose App IDs, type App, description (no spaces), and bundle ID with reverse domain like I mentioned in the previous sentence.
    5. Select capabilities--I had an offline simple app so I didn't select anything.
    6. Then add your device if it's not already added. Mine was.
    7. Finally create the provisioning profile. I selected macOS development and the Mac Catalyst (for testing purposes I just did this. It's recommended you use macOS so that your appID is tied with the iOS version but that wasn't working for me before so I just chose Mac Catalyst).
    8. Next you'll select your app ID, then your certificates, and then your devices.
    9. Enter the name for your provisioning profile. I recommend no spaces but they are accepted.
    10. Click generate. You don't need to download. You can do that from Xcode.
    11. Launch Xcode and go to Settings -> Accounts. Make sure you are signed in to the same developer account. Then click on Download Manual Profiles.
    12. Check the link for going through the step of adding necessary entitlements including make an entitlements.plist if you added features.
    13. Update your Info.plist (check link)
    14. Lastly define the build properties. There's an example in the link. Mine looks like this with codesigning stuff removed:
    <!-- Release Configuration for Mac Catalyst -->
    <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-maccatalyst|AnyCPU'">
        <MtouchLink>SdkOnly</MtouchLink>
        <EnableCodeSigning>True</EnableCodeSigning>
        <CreatePackage>true</CreatePackage>
        <CodesignKey>Step 3 Goes Here</CodesignKey>
        <CodesignProvision>ProvisioningProfileHere</CodesignProvision>
        <CodesignEntitlements>Platforms\MacCatalyst\Entitlements.plist</CodesignEntitlements>
        <UseHardenedRuntime>true</UseHardenedRuntime>
    </PropertyGroup>