To all:
I've been trying to port an app I wrote last summer in Xamarin Forms over to the latest version of .NET MAUI. I had few issues (but not none) with the Android version, but - as usual - iOS is so arcane that either Microsoft's engineers are missing something, or the process really is still just that bad. And I have 17.12.3, the latest update, too.
TLDR: Nab this repository: Try it, and see if you get the same thing. On the "Archive Details" dialog, under "Provisioning Profile", I only get the error message "No matching profiles found." And that is JUST after having defined the profile at developer.apple.com!
Below is the latest set of instructions I tried to work through the evening I posted this Many thanks for any insights!
At AppStoreConnect:
- Apps >> Register a new app ID
Apps >> “+” (Add) >> Fill out screen:
App ID/Prefix/Team ID Description Bundle ID → use reverse domain if you want, say Explicit or “.*” will be required at the end (doesn't mean wild card for any spaces in the name)
Click Register
Go to Apps >> New App NOTE: may take a few minutes for the new ID to show up (bad performance on Apple's part), refresh the screen with F5 until the drop-down has the ID just entered above.
When done, the Distribution tab/screen should read Prepare for Distribution (yellow light icon).
In Visual Studio (Community Edition):
Restart VS if you haven't already.
Create a new project.
Choose .NET MAUI App template (may need to search for “maui” to find it).
On Configure your new project, select the C:\MAUI folder if it hasn't been selected already.
Click Next.
Leave 8.0 support, click Next.
- Click Create, this will generate the base files.
Provisioning and Building:
Right-click on the project name (not the solution name, but the parent right underneath it).
Close (“X”) all the debug windows at screen bottom.
Go to the top of the tree with “Application” and make changes to anything without a “$” symbol.
Open the “iOS” node in the tree at screen left.
Go down to “MAUI Shared”, complete any blanks there.
Scroll past Android to the iOS section, expand the tree at screen left.
Uncheck the LLVM compiler for Release builds.
Bundle Signing section – click on Configure Automatic Provisioning
Try selecting a team. If it fails, close the window and change to Manual Provisioning.
Choose the only iPhone Distribution Certificate (beginning with 2F7)
Leave Provisioning Profile as Automatic.
On the Manifest line, click the link and adjust the Bundle Identifier. Try compiling without adding the 10-char number first.
Change build type to Release if hasn't been done yet.
Do a Clean, and then a Rebuild (which compiles from scratch, not incrementally).
If there are Android licenses needing approval, approve them, then Clean and Rebuild again.
Change the device to the iOS physical device (e.g., “iPhone 12 Device” matching the About page on the iPhone or iPad).
Right-click on the project “head”, one level below the top of the tree. Processing will show “Archiving App Bundle…” The process can take anywhere between 5 and 20 minutes. To see how long the latest build has been going, look at the “Creation Date” field on the second line. NOTE: The Creation Date will change to the compilation completion when it's done.
Creation of IPA file and upload process
This is where .NET MAUI has had problems for me. Can't get to saving to an IPA file.
Click the Distribute… button for the latest build just completed. Double check the archive details in the upper left corner under the screen title to ensure they're correct, especially the bundle iD.
Of the three buttons, click on App Store.
Change the Signing Identity drop-down to the iPhone Distribution option. NOTE: the 10-digit team ID should be selected.
For the Provisioning Profile drop-down, there SHOULD be the provisioning profile ID specified earlier on.
Go back to the CSPROJ file – the second line of the Solution Explorer “tree” and look for iOS, then Bundle Signing. Change back to Automatic Provisioning.
Choose Configure Automatic Provisioning again.
Choose a team. Again, if an error message occurs, exit Visual Studio completely, doing a Save All before exiting.
Restart VS, and even the PC if desired.
Choose the last project edited, it will be on top. Wait for the computer to reconnect to the Mac computer with Pair To Mac (do it manually if needed).
Double-Checking
Go to developer.apple.com and sign in ON THE MAC COMPUTER (not the Windows one running VS).
Click on Profiles.
Locate the App ID defined above.
Select ALL Certificates, all boxes should be checked.
Select ALL Devices, all devices should be checked.
Ensure the name reads: “VS: WildCard Development” exactly.
Click Save.
On the Generate A Provisioning Profile screen, click on Download.
In the browser's Downloads folder, there will be a file called:
VS_WildCard_Development.mobileprovision
Double-click on this file to install it, it will wind up in Xcode, which VS has to “talk” to in order to get ID's and numbers and names correct.
Exit VS and restart it.
Go to the CSPROJ (second line of the tree in the Solution Explorer).
Choose Manual Provisioning.
For Signing Identity, ensure it reads the iPhone Distribution.
For Provisioning Profile, open the drop-down and select VS: WildCard Development.
Right-click on the CSPROJ file.
At this point I gave up. Either I'm missing something, or there's still serious bugs on the iOS side for .NET MAUI. Working with Xamarin Forms last year was complicated, but at least I was finally able to generate something I could upload with Transporter. Can anyone see where I slipped up? Thanks.
The public GitHub repository is here (and it's just the default MAUI project, nothing fancy):
Any help or insights would be greatly appreciated. I really like how far MAUI has come with Android, but iOS is like programming in the Rosetta Stone. I wonder if I need a special incantation to make this work.