-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Developing a Maui Blazor MacCatalyst app for Apple macOS store is a terrible experience #12293
Comments
Microsoft should document all the issues and solutions you figured out. And hopefully make the whole experience better. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
@rolfbjarne thoughts on any of these issues here? |
This is great feedback! Thanks a lot!
I'm not sure what caused this, a binlog would likely be nice to diagnose.
Mac Catalyst will default to a universal (arm64+x64) build when building for a Release configuration (and just x64 for all other configurations). But yes, we can add a comment to the templates as well. For most of the other publishing issues I filed xamarin/xamarin-macios#17591 to improve our templates and build logic. @rachelkang you might want to update your MAUI templates as well. |
I am also trying to deploy to macOs and get things running. This issue has helped me sign and get the app into TestFlight and distribute for testing. Our app is a .net7.0, (non Blazor) MAUI app for windows/macOs, compiled on Monterey Intel mac and but crashes on another machine (Ventura M1 arm mac), this is all I have to test at the mo, so trying to work that out. |
@brightertools , since you have gotten dotnet/docs-maui#1187 to work, perhaps you could help me understand what to use for YOURNAME (*******) and YOUR PROFILE NAME.
For what it is worth, I compile and run my MacCatalyst app on my Mac Mini, which is an M1. Previously I was using a 2014 Mac Mini and it would also compile and run my MacCatalyst app. Have you tried building on your M1 Mac? |
Hi @cdavidyoung Thanks for your message. Following the guide you will need to create the certificates (x2) and download them to your computer. The: 3rd Party Mac Developer Installer: YOURNAME (*******) is copied from the other certificate name The profile name is the name created when creating the profile in the "Certificates, Identifiers & Profiles" section of the apple developer site. I am developing mainly on Windows then opening on my Mac to publish (Visual Studio seems a bit slower to develop on Mac, from key commands to building and running) It's not straight forward what might work or not in the "sandbox" or if I am worried about that too much, given the entitlements which are not that clear. The process of setting up a new app, just for testing and re-building the app until it fails seems like a long winded unnecessary process, but it's hard to tell if the error is build, platform, signing or code related. |
Ok, this is what one of my certificates says:
Certificate Name Charles Young
Certificate Type Mac Installer Distribution
Expiration Date 2024/02/29
Created By Charles Young ***@***.***)
It is still not clear but perhaps YOURNAME (*******) is actually Charles
Young ***@***.***)? And the profile name is the one right
under the Name label ( "******" ) when viewing the profile?
Review Provisioning Profile
Name "******"
Status Active
Platform macOS
Regarding the Mid 2015 mac and the M1 Mac, I found that when I migrated
from my 2014 Mac Mini to the recent M1 Mac Mini certain applications would
not run until different versions were installed. I believe this was the
difference between the Intel chip of the older Macs and the newer Macs with
the Apple M1 chip. I even had trouble building my app on the M1 Mac until
VS and Xcode updated to compatible versions. I don't understand it but
perhaps this has something to do with your problem. You might just have to
upgrade your 2015 Mac to a more recent model. I just picked up my M1 Mac
Mini at Costco for $400. The M2 is just $200 more and it will run circles
around your 2015 Mac.
…On Thu, Mar 2, 2023 at 6:05 AM Mark Redman ***@***.***> wrote:
@brightertools <https://github.com/brightertools> , since you have gotten
dotnet/docs-maui#1187 <dotnet/docs-maui#1187>
to work, perhaps you could help me understand what to use for YOURNAME
(*******) and YOUR PROFILE NAME.
<CodesignKey>Apple Distribution: YOURNAME (*******)</CodesignKey>
<CodesignEntitlements>Platforms\MacCatalyst\Entitlements.plist</CodesignEntitlements>
<CodesignProvision>YOUR PROFILE NAME</CodesignProvision>
<PackageSigningKey>3rd Party Mac Developer Installer: YOURNAME (*******)</PackageSigningKey>
For what it is worth, I compile and run my MacCatalyst app on my Mac Mini,
which is an M1. Previously I was using a 2014 Mac Mini and it would also
compile and run my MacCatalyst app. Have you tried building on your M1 Mac?
Hi @cdavidyoung <https://github.com/cdavidyoung>
Thanks for your message.
Following the guide you will need to create the certificates (x2) and
download them to your computer.
The: Apple Distribution: YOURNAME (*******) is copied from the one
certificate name
The: 3rd Party Mac Developer Installer: YOURNAME (*******) is copied from
the other certificate name
The profile name is the name created when creating the profile in the
"Certificates, Identifiers & Profiles" section of the apple developer site.
In xode you need to login to your account and download the manual
profiles.. this is the profile with the matching name I beleive.
I am developing mainly on Windows then opening on my Mac to publish
(Visual Studio seems a bit slower to develop on Mac, from key commands to
building and running)
I only have a Mid 2015 mac, the app uns fine locally, but does not run on
either my mac or another M1 mac via TestFlight. it just crashes.. searched
around and found loads of things to try but its so trial and error.
It's not straight forward what might work or not in the "sandbox" or if I
am worried about that too much, given the entitlements which are not that
clear.
The process of setting up a new app, just for testing and re-building the
app until it fails seems like a long winded unnecessary process, but it's
hard to tell if the error is build, platform, signing or code related.
—
Reply to this email directly, view it on GitHub
<#12293 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHE7KZX6KGJIZYKUX7AFSLW2CLINANCNFSM6AAAAAATIMHHBA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yes, ProfileName is the Name field from the "Provisioning Profile" in the apple account area. The others I copy/pasted these certificate names exactly from the Mac's Keychain Access > My Certificates. My apple account is an organisation account, so has the company name, when I first set up the certificates I seemed to have loads my name and company name, and at some point deleted them all and re-created them (just the 2 required) and manually downloaded the profile in xcode via Xcode > Preferences > Account > Select Admin Account > Download Manual Profiles Settings in the project for these are:
I will be updating my mac, the mini is a good call. UPDATE: Purchased Macbook Pro M2, nor cannot publish the app.. lovely... will now figure that one out first And noticed running VS on windows on Parallels doesn't support MAUI.. |
Working through your issue here and editing as I go along. New templates implemented in #14219 solve following issues:
Other MAUI issues:
Issues for VS for Mac Team:
Issue for .NET Core team:
|
I'll try to address all the issues line by line here. Note: In addition to updating the templates for MAUI MacCatalyst apps to include what is necessary for publishing, the MAUI MacCatalyst Publishing documentation has also been updated, and has additional information. You can access it at aka.ms/publish-maui-app-store. Developing a MacCatalyst app:
It looks like the VS for Mac team was looking into this, but their followup fizzled out. I will say though when it comes to building in Visual Studio, the behavior of building only using the selected platform in the IDE will only work when the Debug target is selected in the IDE. This type of target filtering does not exist for Release. Building for release in the IDE isn't really a replacement gesture for a proper archive for publishing through the IDE or from the CLI.
It appears that the VS for Mac team have included a fix in the latest preview version of VS for Mac 2022 Preview: https://developercommunity.visualstudio.com/t/Building-IOS-Release-generate-error-the/10208351 (check last comment in thread)
It appears that this issue has to do with the iOS simulator when on M1/M2 Macs. This is a problematic issue because if we set this as a default, it could affect other libraries. We will see about getting this change into the IDE itself, but the suggested fix is to add this to the csproj within a Maui Blazor solution:
It looks like this is aspnetcore's wheelhouse. I saw that you had a workaround for this, but an additional recommendation is to add this to your csproj to reduce trimming for iOS/MacCatalyst:
We have a fix submitted for that on the .NET for iOS side here: xamarin/xamarin-macios#17829
For both of these issues, It appears this issue occurs due to an entitlement that is automatically added and removed by Apple in Xcode during debugging. This is updated in our our templates as per #14196 , but for now, please add this to your Entitlements.plist:
Publishing a MacCatalyst app on Apple macOS store:
Solution added to templates in #14196
Solution added to templates in #14196
Solution added to templates in #14196
Solution added to templates in #13910
Solution added to templates in #14196
I've made a comment in this issue, but essentially this falls on an issue where Apple is not using the CFBundleDisplayName in the tool tip you get when you hover over the application in the app dock. I will file a feedback ticket to Apple to see if we can get that fixed. Unfortunately for now, it will have to rely on what is set for your Application Title.
Solution added to templates in #14196
Solution added to templates in #14196. I hope these changes and suggestions will help improve your experience with publishing your MAUI Blazor MacCatalyst app for the Mac App Store! |
@dustin-wojciechowski Thank you very much for looking into this. One of the last obstacles was #13094 but after fixing it, I still can't publish. After these two entitlements were added, the
|
I am getting the exact same crash report after downloading from TestFlight. I opened an issue trying to get some clarification on the documentation. @dustin-wojciechowski I have not gone through your long list of solutions yet. It is not clear whether you have been successful in publishing a Mac app. If so, was it in association with the iOS version of the same app? |
Yes, that's xamarin/xamarin-macios#14686. There are two known workarounds: either use a Mac (not Mac Catalyst) provisioning profile, or add this to the project file: xamarin/xamarin-macios#14686 (comment). |
@rolfbjarne I am already doing the fix to .csproj. Could you be a little more explicit about "use a Mac (not Mac Catalyst) provisioning profile". Do I need to create a new profile or modify the existing CacheAll MacCatalyst Rolf?
|
Yes, you need to create a new profile, because Apple doesn't allow you to change an existing one. The profile should look like the second screenshot here: xamarin/xamarin-macios#14686 (comment) |
@rolfbjarne Alright, this profile works! I can finally run from TestFlight. One caveat is that I have not tried to publish a new version of the iOS app. I don't know if anything I did here will affect that. Thanks for you help, Rolf! |
@rolfbjarne I am pleased to announce that my .net Maui Mac app, CacheAll, has been accepted on the App Store. Now my app is available for all 4 platforms. Whew. So has documentation been updated to reflect all the correct steps necessary to publish iOS and MacCatalyst? I am not even sure that I could do it again correctly. There have been too many trials and errors even after trying to follow the current documentation https://learn.microsoft.com/en-us/dotnet/maui/mac-catalyst/deployment/?view=net-maui-7.0 several times. |
@davidbritch I think this page (https://learn.microsoft.com/en-us/dotnet/maui/mac-catalyst/deployment/?view=net-maui-7.0) needs to be updated with the findings from this issue (see previous comment). |
Glad you got this working, I am now back onto trying to get this to work after abandoning this to get it into the Microsoft Store, I am not able to get it running via TestFlight without crashing, and logging to email to let me know what going on, the app is now running, but the UI Content Pages are not displaying.. its very much trial and error, hard to not go around in circles. How can it work in dev, and via Microsoft Store but not via TestFlight? so annoying |
@brightertools Does your app work on iPhone or just desktops? Is your app made public on the Microsoft Store? Regarding UI Content Pages are not displaying, I am not having that problem on the Mac but it does happen on Android. Rotating the screen will usually cause it to appear. I don't have the problem on Windows or iPhone. |
Hi, It's not publicaly searchable , I am trying to deploy the same app for macOs (not interested in IOS or Android) but just cannot get it to run via TestFlight, works perfectly fine via Visual Studio on Mac. (Latest VS, Apple M2 Max) Added NLog for Maui (nit sure where the logs go but added an email target to try and see where its fails) There are not errors, the main page loads (as does the main ViewModel with a timer that performs some tasks) its seems the code runs on the ViewModel, timer starts and performs tasks, but no windows/UI/Pages are visible. There is no UI at all, not even any container/window, and the main menu bar has no items. Tried various configurations of creating the Page / ViewModels (using MVVM toolbox) but cannot get it run properly on MacOS. Is working fine on windows via VS and deployed via the MS Store. One thing I have noticed is that the App (App.xml.cs) seems to be called twice. |
@brightertools I understand your frustration. If you read through the thread you can see that @rolfbjarne helped me finally get this working. You might ping him to see what he suggests. Good luck! |
There is nothing definitive about how I move forward from this point, its poking & hoping, trial and error, it shouldn't be as bad as this... |
I have been trying many things now, the app doesn't crash anymore, and there are no errors, but the XAML page just doesn't render.. It seems on MacOs the Pages and ViewModels are not Singletons, they get recreated multiple times, it looks like they get created 4 times each based on my logs.. This was creating some hanging (got one message related to something already exists [was registering a callback after setting pages loses ie WeakReferenceMessenger.Default.Register(this, (r, m)...], but no other errors many try..catch blocks that don't get hit) I moved all code from constructors to own methods and had to add an hacky init flag to get around this. I ended up added an empty Page as the startup page with a start button, when I navigate to the MainPage now, it's blank but at east there is a UI rather than no windows associated with the app, the page must load as it loads the Viewmodel and runs tasks on a timer on that ViewModel, lots from that are being generated.. Again this app works on windows and is deployed to the Microsoft Store, I really don't get why this works in dev and not after deployment to TestFlight, the whole point of MAUI is to work cross platform with the same code. |
Apparently there is a bug in ILStrip on MacOS that can affect some functions (a DateTime.TryParse in my case). The workaround is to disable ILStrip via the project file: Include this until they fix the problem, or who knows what might not work properly. |
I have tried this via TestFlight, upload no. 59 :) but unfortunately hasn't had any visible results in this case, I do appreciate your reply and is good to know for future ref (and leaving it in for now) I am contemplating making the repo public, and hesitant to reach out to individuals, I appreciate these are not all your problems....but certainly running out of logical options... I can outline a few things in the app that might highlight anything to check:
(issues existed before Telerik controls added) |
@brightertools Would you mind making a new issue (if you haven't already) for your issue with the XAML page not rendering so that we can take a look at it a bit more closely? |
I started removing a load of things from the UI, until I remove all the Telerik Controls, I was using the latest version of the controls, but had to set a specific MAUI version in the project file. I was then able to see the UI, although still had issues with data loading etc.. It turns out Windows is much more forgiving when it comes to the ViewModel reference and bindings, I had to specifically set page/controls names, data types etc and carefully look at all the bindings. Also loading images (in my case via url) in item lists views (built in MAUI or Telerik controls) uses loads of memory, so watch image size served form the web. I still have issues with the file selection and saving, still looking at that and have no idea where MAUI specific Nlog Logs go, but used an email target to debug (via testflight) which worked better than nothing. |
Hello, We have tried our best to alleviate as much of these issues as we had in our power to do. I encourage all developers developing Maui Blazor applications for MacCatalyst for the Apple MacOS store to give publishing another shot with the upcoming .NET 8 release. And of course, if any problems occur, please feel free to create a new issue so we can look at it. Happy developing! |
Hello @dustin-wojciechowski Thank you for looking into this. I gave up trying to publish with .NET 7 and it was my intention to try again with .NET 8 so your announcement is really welcome. I will give it another try with .NET 8 |
This is appreciated and will certainly try this.. To get the MacOs working has been very time consuming, We are developing for both MacOs and Windows desktop.. learning that Visual Studio Mac is going to be discontinued was pretty bad news since we use Visual studio for both Mac and Windows on this project. I fear more time will be spent trying to re-discover what doesnt work in VS-Code and who knows how seamless the migration will be, not to mention now having to work with either VS-Code for Mac and Visual Studio for windows or having to start setting up and using VS-Code for windows to make that seamless... its just feels like the MacOs 'terrible experience' is going to continue for some time? Please consider the migration paths to XCode and also working on the same project with XCode and Visual Studio. Thanks. which makes me thinks, is XCode going to replace Visual Studio on PC as well, at some point? |
Description
There are many things that could be better.
Developing a MacCatalyst app:
Building a Release version on Visual Studio for Mac always builds for the first framework in TargetFrameworks, not the selected framework
Visual Studio for Mac can not run any MAUI project in Release mode:
it doesn't work with XCode 14.2 and iOS 16.2
Microsoft.AspNetCore.Components.Web.HeadOutlet
throws exception in the trimmed versionadding signing to csproj results in
error MSB6006: "codesign" exited with code 3.
Publishing a MacCatalyst app on Apple macOS store:
rejected when trying to upload with Transporter:
The product archive package's signature is invalid. Ensure that it is signed with your "3rd Party Mac Developer Installer" certificate.
A commented section incsproj
that the developer could un-comment would be helpful here.rejected when trying to upload with Transporter:
The product archive is invalid. The Info.plist must contain a LSApplicationCategoryType key, whose value is the UTI for a valid category. For more details, see "Submitting your Mac apps to the App Store".
Some indication in Visual Studio would be helpful here. I had to add:rejected when trying to upload with Transporter:
Invalid bundle. The bundle supports arm64 but not Intel-based Mac computers. Your build must include the x86_64 architecture to support Intel-based Mac computers.
A commented section incsproj
that the developer could un-comment would be helpful here:<RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers>
rejected when trying to upload with Transporter:
Invalid Bundle. The key UIDeviceFamily in the app's Info.plist file contains one or more unsupported values '1'. (ID: e98a0fc1-d792-4b2d-854c-51a5d1649c82)
I had to changeto
App sandbox not enabled. The following executables must include the "com.apple.security.app-sandbox" entitlement with a Boolean value of true in the entitlements property list
Adding aPlatforms/MacCatalyst/Entitlements.plist
file and<CodesignEntitlement>Platforms/MacCatalyst/Entitlements.plist</CodesignEntitlement>
insidecsproj
would be helpful here. I had to add:rejected because project name is used instead of application title: Can't set the app name in MacCatalyst project for macOS #12287
I had to add
<key>ITSAppUsesNonExemptEncryption</key><false/>
toInfo.plist
. Some indication in Visual Studio would be helpful here.Maui Blazor template lacks entitlements necessary to submit to Apple macOS store
[net6][Catalyst] Testflight published app fails to start with
security policy does not allow @ path expansion
xamarin/xamarin-macios#14686[templates] Add comments to help developers xamarin/xamarin-macios#17591
Steps to Reproduce
Link to public reproduction project repository
https://github.com/Jinjinov/Ididit
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
macOS Ventura 13.1
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: