You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Pri1High priority, do before Pri2 and Pri3doc-ideaIndicates issues that are suggestions for new topics [org]
At the moment the publish a Mac app doc is CLI only, for unsigned apps.
The story for Mac Catalyst publishing is that it's not possible on Windows, but it is possible on a Mac. However, it's not currently possible as an end-to-end scenario in VSMac. The solution is:
Create certs in your Apple Developer Account.
Use the Apple developer portal to create the App ID and provisioning profile.
Set entitlements, depending on your distribution channel.
Edit your .csproj to add the required build properties (which are different depending on how you're distributing your app).
Use the CLI to publish the app.
This approach requires an Apple Distribution certificate, and a Mac Installer certificate.
Create a doc that covers distribution to the App Store using this approach.
Note: this distribution channel is only an option for individual Apple accounts.
Your entitlements look good. I was just checking you had <key>com.apple.security.network.client</key>. So the next area to look at is your Info.plist file. Is your app doing anything like using maps, getting location, accessing the file system?
Here's my thinking, so you know where I'm coming from. TCC_CRASHING_DUE_TO_PRIVACY_VIOLATION usually occurs because the app is attempting to access privacy-sensitive data without a usage description for it in Info.plist. So depending on what you're app is actually doing (maps, location, file system, photos, camera etc.) you may well be missing an Info.plist entry. It's often the case that they aren't required for debug builds, but are for release builds.
Something else to try is to comment out the PropertyGroup in your .csproj for your release config, to stop the code-signing etc. Then run a freshly built release build (having deleted bin/obj first) and see if you get anything that indicates a missing Info.plist key/description.
@davidbritch So I commented out the PropertyGroup in my .csproj for my release config and I was able to Start Without Debugging. It would not allow me to Start Debugging. This is an improvement, but it runs perfectly normally with no hint of a a missing Info.plist key/description. I was able to take a photo and record audio without a problem. Of course, the GPS does not work on the Mac but the standard Apple map comes up fine and plots markers of photos that I have recorded with my iPhone.
@davidbritch Here is the change to the .csproj file with the release commented out. The debug config runs fine in the debugger.
<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
<MtouchLink>none</MtouchLink>
<EnableCodeSigning>false</EnableCodeSigning>
<ProvisionType>Manual</ProvisionType>
<CreatePackage>false</CreatePackage>
<EnablePackageSigning>true</EnablePackageSigning>
<CodesignKey>Apple Distribution: Charles Young (83Q3M48Y8B)</CodesignKey>
<CodesignEntitlements>Platforms\MacCatalyst\Entitlements.plist</CodesignEntitlements>
<CodesignProvision>CacheAll CacheAll Mac App Store</CodesignProvision>
<PackageSigningKey>3rd Party Mac Developer Installer: Charles Young (83Q3M48Y8B)</PackageSigningKey>
<UseHardenedRuntime>false</UseHardenedRuntime>
</PropertyGroup>
<!-- <PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
<MtouchLink>SdkOnly</MtouchLink>
<RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers>
<EnableCodeSigning>True</EnableCodeSigning>
<ProvisionType>Manual</ProvisionType>
<CreatePackage>true</CreatePackage>
<EnablePackageSigning>true</EnablePackageSigning>
<CodesignEntitlements>Platforms\MacCatalyst\Entitlements.plist</CodesignEntitlements>
<CodesignKey>Apple Distribution: Charles Young (83Q3M48Y8B)</CodesignKey>
<CodesignProvision>CacheAll CacheAll Mac App Store</CodesignProvision>
<PackageSigningKey>3rd Party Mac Developer Installer: Charles Young (83Q3M48Y8B)</PackageSigningKey>
<UseHardenedRuntime>true</UseHardenedRuntime>
</PropertyGroup>-->
@davidbritch So I am still trying to figure out why the FlightTest app is quietly quitting without a crash report. I just want to point out that I think I initially addressed the TCC_CRASHING_DUE_TO_PRIVACY_VIOLATION when I fixed the thread #5 crash which was apparently caused by a xaml problem.
As you suggested, commenting out the release configuration allows the app to run fine locally. So it must have something to do with the provisioning, right? Apple is just not signing it in a way that allows it to run from FlightTest.
The following entries aren't required in your release config:
maccatalyst-x64;maccatalyst-arm64 - this is the default for release configs, hence doesn't have to be explicitly enabled.
Manual - this is inferred from other settings.
true - this isn't required for Mac App Store apps.
I noticed you were using the hardened runtime last week, but didn't think it would be necessarily causing a problem. Then I read this:
"The Hardened Runtime is a collection of system-enforced restrictions that disable a set of functional capabilities, such as loading third-party frameworks, and prohibit access to restricted resources, such as the device’s built-in camera, to prevent certain classes of exploits from compromising the runtime integrity of your macOS app. If your app relies on something the Hardened Runtime restricts, you remove that specific protection by adding an entitlement to your app’s entitlements file. Xcode’s Hardened Runtime capability provides an easy way to manage those entitlements." - from https://developer.apple.com/documentation/xcode/configuring-the-hardened-runtime
So because you've enabled the hardened runtime, you've disabled the ability to access the camera. Your app wants that access which maybe what's causing your privacy violation.
In fact, the UIDeviceFamily definition in your Info.plist file prevented me from even uploading an app to the App Store with Transporter (at the same time, I don't have the hardened runtime enabled for my app).
@davidbritch Thanks for the new things to try. I can report a little bit of progress. At least now when it crashes it gives me a crash report! Of course I did a clean all and deleted obj/bin before doing the publish.
dotnet publish -f:net7.0-maccatalyst -c:Release
It looks like I am missing a library. Here is my config and a snippet from the crash report.
<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
<MtouchLink>SdkOnly</MtouchLink>
<RuntimeIdentifiers></RuntimeIdentifiers>
<EnableCodeSigning>True</EnableCodeSigning>
<ProvisionType></ProvisionType>
<CreatePackage></CreatePackage>
<EnablePackageSigning>true</EnablePackageSigning>
<CodesignEntitlements>Platforms\MacCatalyst\Entitlements.plist</CodesignEntitlements>
<CodesignKey>Apple Distribution: Charles Young (83Q3M48Y8B)</CodesignKey>
<CodesignProvision>CacheAll CacheAll Mac App Store</CodesignProvision>
<PackageSigningKey>3rd Party Mac Developer Installer: Charles Young (83Q3M48Y8B)</PackageSigningKey>
<UseHardenedRuntime></UseHardenedRuntime>
</PropertyGroup>
Termination Reason: Namespace DYLD, Code 1 Library missing
Library not loaded: @executable_path/../MonoBundle/libSystem.IO.Compression.Native.dylib
Referenced from: <98C66449-3327-3656-BD30-6FBF749806F7> /Users/USER/*/CacheAll.app/Contents/MacOS/CacheAll
Reason: tried: '/System/Volumes/Preboot/Cryptexes/OS@executable_path/../MonoBundle/libSystem.IO.Compression.Native.dylib' (no such file), '/usr/lib/libSystem.IO.Compression.Native.dylib' (no such file, not in dyld cache), (security policy does not allow @ path expansion)
(terminated at launch; ignore backtrace)
@davidbritch I tried to implement their fix but I am still getting the same error. Perhaps I am not putting the 2 lines in the right place?
<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
<MtouchLink>SdkOnly</MtouchLink>
<_LibMonoLinkMode>Static</_LibMonoLinkMode>
<_LibXamarinLinkMode>Static</_LibXamarinLinkMode>
<RuntimeIdentifiers></RuntimeIdentifiers>
<EnableCodeSigning>True</EnableCodeSigning>
<ProvisionType></ProvisionType>
<CreatePackage></CreatePackage>
<EnablePackageSigning>true</EnablePackageSigning>
<CodesignEntitlements>Platforms\MacCatalyst\Entitlements.plist</CodesignEntitlements>
<CodesignKey>Apple Distribution: Charles Young (83Q3M48Y8B)</CodesignKey>
<CodesignProvision>CacheAll CacheAll Mac App Store</CodesignProvision>
<PackageSigningKey>3rd Party Mac Developer Installer: Charles Young (83Q3M48Y8B)</PackageSigningKey>
<UseHardenedRuntime></UseHardenedRuntime>
</PropertyGroup>
@davidbritch I tried removing those lines and I also tried using the config recommended in the link below but I am still getting the same "security policy does not allow @ path expansion" error.
@davidbritch So I spent all day yesterday following the instructions in your doc but I am still getting the same error. There are some confusing parts to the doc where I may be making the wrong decisions. I'll describe them as a new issue on the doc page.
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Pri1High priority, do before Pri2 and Pri3doc-ideaIndicates issues that are suggestions for new topics [org]
Activity
[-]VSMac: Publish a Mac app[/-][+]VSMac: Publish a Mac Catalyst app[/+][-]VSMac: Publish a Mac Catalyst app[/-][+]Publish a Mac Catalyst app[/+][-]Publish a Mac Catalyst app[/-][+]Publish a Mac Catalyst app to the App Store[/+]35 remaining items
davidbritch commentedon Mar 30, 2023
Your entitlements look good. I was just checking you had
<key>com.apple.security.network.client</key>. So the next area to look at is your Info.plist file. Is your app doing anything like using maps, getting location, accessing the file system?davidbritch commentedon Mar 30, 2023
Here's my thinking, so you know where I'm coming from. TCC_CRASHING_DUE_TO_PRIVACY_VIOLATION usually occurs because the app is attempting to access privacy-sensitive data without a usage description for it in Info.plist. So depending on what you're app is actually doing (maps, location, file system, photos, camera etc.) you may well be missing an Info.plist entry. It's often the case that they aren't required for debug builds, but are for release builds.
davidbritch commentedon Mar 30, 2023
Something else to try is to comment out the PropertyGroup in your .csproj for your release config, to stop the code-signing etc. Then run a freshly built release build (having deleted bin/obj first) and see if you get anything that indicates a missing Info.plist key/description.
cdavidyoung commentedon Mar 30, 2023
@davidbritch Here is my Info.plist file. It has the same list of access that my iOS app has that is currently live on the App Store.
Thanks for all your help, BTW! This stuff is so confusing.
As far as maps, location, file system, photos, camera, etc, yes I do them all in this app. I also record and play audio.
Looking at your last recommendation, after I do the release build do you mean you want me to try and publish it to the App Store?
cdavidyoung commentedon Mar 30, 2023
@davidbritch So I commented out the PropertyGroup in my .csproj for my release config and I was able to Start Without Debugging. It would not allow me to Start Debugging. This is an improvement, but it runs perfectly normally with no hint of a a missing Info.plist key/description. I was able to take a photo and record audio without a problem. Of course, the GPS does not work on the Mac but the standard Apple map comes up fine and plots markers of photos that I have recorded with my iPhone.
cdavidyoung commentedon Mar 31, 2023
@davidbritch Here is the change to the .csproj file with the release commented out. The debug config runs fine in the debugger.
cdavidyoung commentedon Apr 2, 2023
@davidbritch So I am still trying to figure out why the FlightTest app is quietly quitting without a crash report. I just want to point out that I think I initially addressed the TCC_CRASHING_DUE_TO_PRIVACY_VIOLATION when I fixed the thread #5 crash which was apparently caused by a xaml problem.
As you suggested, commenting out the release configuration allows the app to run fine locally. So it must have something to do with the provisioning, right? Apple is just not signing it in a way that allows it to run from FlightTest.
davidbritch commentedon Apr 3, 2023
The following entries aren't required in your release config:
I noticed you were using the hardened runtime last week, but didn't think it would be necessarily causing a problem. Then I read this:
"The Hardened Runtime is a collection of system-enforced restrictions that disable a set of functional capabilities, such as loading third-party frameworks, and prohibit access to restricted resources, such as the device’s built-in camera, to prevent certain classes of exploits from compromising the runtime integrity of your macOS app. If your app relies on something the Hardened Runtime restricts, you remove that specific protection by adding an entitlement to your app’s entitlements file. Xcode’s Hardened Runtime capability provides an easy way to manage those entitlements." - from https://developer.apple.com/documentation/xcode/configuring-the-hardened-runtime
So because you've enabled the hardened runtime, you've disabled the ability to access the camera. Your app wants that access which maybe what's causing your privacy violation.
davidbritch commentedon Apr 3, 2023
Also, in your Info.plist:
Should just be:
See https://learn.microsoft.com/en-gb/dotnet/maui/mac-catalyst/deployment/publish-app-store?view=net-maui-7.0#specify-the-user-interface-idiom
In fact, the UIDeviceFamily definition in your Info.plist file prevented me from even uploading an app to the App Store with Transporter (at the same time, I don't have the hardened runtime enabled for my app).
cdavidyoung commentedon Apr 3, 2023
@davidbritch Thanks for the new things to try. I can report a little bit of progress. At least now when it crashes it gives me a crash report! Of course I did a clean all and deleted obj/bin before doing the publish.
dotnet publish -f:net7.0-maccatalyst -c:Release
It looks like I am missing a library. Here is my config and a snippet from the crash report.
Crashed Thread: 0
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: Namespace DYLD, Code 1 Library missing
Library not loaded: @executable_path/../MonoBundle/libSystem.IO.Compression.Native.dylib
Referenced from: <98C66449-3327-3656-BD30-6FBF749806F7> /Users/USER/*/CacheAll.app/Contents/MacOS/CacheAll
Reason: tried: '/System/Volumes/Preboot/Cryptexes/OS@executable_path/../MonoBundle/libSystem.IO.Compression.Native.dylib' (no such file), '/usr/lib/libSystem.IO.Compression.Native.dylib' (no such file, not in dyld cache), (security policy does not allow @ path expansion)
(terminated at launch; ignore backtrace)
Thread 0 Crashed:
0 dyld 0x19d437190 __abort_with_payload + 8
1 dyld 0x19d441a00 abort_with_payload_wrapper_internal + 104
2 dyld 0x19d441a34 abort_with_payload + 16
3 dyld 0x19d3d00a4 dyld4::halt(char const*) + 328
4 dyld 0x19d3cd098 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 4204
5 dyld 0x19d3cbdc4 start + 2404
cdavidyoung commentedon Apr 3, 2023
@davidbritch dotnet/macios#14686 covers this issue. There seems to be a solution but I am a little unsure how to implement it.
cdavidyoung commentedon Apr 3, 2023
@davidbritch I tried to implement their fix but I am still getting the same error. Perhaps I am not putting the 2 lines in the right place?
davidbritch commentedon Apr 4, 2023
You need to completely remove:
cdavidyoung commentedon Apr 4, 2023
@davidbritch I tried removing those lines and I also tried using the config recommended in the link below but I am still getting the same "security policy does not allow @ path expansion" error.
https://learn.microsoft.com/en-gb/dotnet/maui/mac-catalyst/deployment/publish-app-store?view=net-maui-7.0#specify-the-user-interface-idiom
I think I am going to start over at the beginning of this doc and go through the whole process again. Perhaps I made a mistake the first time.
cdavidyoung commentedon Apr 6, 2023
@davidbritch So I spent all day yesterday following the instructions in your doc but I am still getting the same error. There are some confusing parts to the doc where I may be making the wrong decisions. I'll describe them as a new issue on the doc page.