macOS - Failed to Distribute - Invalid Code Signing Entitlements

Hi,

I am trying to distribute my Flutter macOS app, but it fails systematically.

The application works perfectly locally (in both Debug & Release modes).

My application uses the com.apple.developer.aps-environment entitlement (Push Notifications).

I set this entitlement to "production" everywhere (DebugProfile.entitlements, Release.entitlements & RunnerProfile.entitlements).

I have macOS distribution provisioning profile.

When I am running the 'Archive', I selected as destination: "Any Mac (Apple Silicon, Intel)".

When I am trying to deliver the archive, I receive the following error:

Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on macOS. Specifically, value 'development' for key 'com.apple.developer.aps-environment' in ...

and this... for every single asset !!

My configuration is:

Flutter 3.16.2 XCode 15.0.1 Mac OS: Ventura 13.6.1 Hardware: Mac mini 2018 Any help will be more than welcome...

Thanks in advance,

Just to be clear, in the "Select a method for distribution" dialog, are you selecting "TestFlight & App Store"?

After hours and hours, I managed to distribute it to TestFlight, BUT, the application directly crashes when I run it:

Library Not loaded => code signature invalid.

So I started all over.

I have created a new certificate - Mac App Distribution I have created a new Provisioning Profile - Mac App

At XCode level, I have unselected the "Automatically manage signing" and when I am trying to import the Provisioning Profile, XCode says that the signing certificate could not be found...

macOS - Failed to Distribute - Invalid Code Signing Entitlements
 
 
Q