Invalid Code Signing Entitlements

Hi, I have a .NET MAUI app which I've added subscriptions to using the Plugin.InAppBilling nuget package. When I tested on TestFlight I got an almost immediate crash. After doing some research I followed advice to add an Entitlements.plist file to Platforms > iOS with the following entry:

<key>com.apple.developer.in-app-purchase</key> <true/>

The distribution provisioning profile I'm using to sign my app has the App ID set to an Identifier which has "In-App Purchase" ticked, but greyed out in it's "Capabilities" section on https://developer.apple.com/. I'm not sure why it's ticked and greyed out, but I assume that means that "In-App Purchase" is enabled.

The app runs file locally but when I create an IPA file and add it to Transporter for upload to App Store Connect I get the following error:

"Validation failed (409)

Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, key 'com.apple.developer.in-app-purchase' in 'Payload/[Removed].app/[Removed]' is not supported. (ID: [Removed])".

Here is the structure of my csproj code for creating a IPA file for iOS:

<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'"> <RuntimeIdentifier>ios-arm64</RuntimeIdentifier> <!-- Only needed when you have a need for entitlements --> <CodesignEntitlement>Entitlements.plist</CodesignEntitlement> <CodesignKey>[Removed]</CodesignKey> <CodesignProvision>[Removed]</CodesignProvision> </PropertyGroup>

The command I use:

dotnet publish [Removed]/app.csproj -f:net9.0-ios -c:Release ^ /p:PlatformTarget=Arm64 ^ /p:RuntimeIdentifier=ios-arm64 ^ /p:ServerAddress=[Removed] ^ /p:ServerUser=[Removed] ^ /p:ServerPassword=[Removed] ^ /p:ArchiveOnBuild=true ^ /p:BuildIpa=true

I'm stuck trying to figure this out. If you could please point out any issues with what I'm doing or if you have any suggestions to resolve the problem I would very much appreciate it.

Thanks, Ben

Answered by DTS Engineer in 854087022

See my response on this thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

See my response on this thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi @DTS Engineer, thank you for your reply. I've removed the entitlements.plist entry.

Could you help confirm if it is expected that in my distribution provisioning profile "In-App Purchase" is ticked, but greyed out in it's "Capabilities" so I can't edit it?

Also, before I added the entitlements.plist I was able to successfully use Transporter on my Mac to send my IPA file to App Store Connect. However, when I tested the app using TestFlight it was crashing on start every time. I've got the crash file, but I'm not sure it's very helpful (I've attached it). Is the any help of guidance you can give for figuring out why it's crashing? It works perfectly locally in debug/release mode.

Thanks, Ben

I have the same problem. Dis you solve that? I do not have a crash on payment, because I set IgnoreInvalidProducts with true value. But with this case i can not receive my subscriptions… I receive invalid products array with my subscription ID… I can offer you to try this: https://github.com/9khub/MAUI.StoreKit2

Removing the Entitlements.plist did solve the "Validation failed (409)" error, but my app was still crashing on launch in TestFlight.

I had to add <MtouchLink>None</MtouchLink> to my csproj file to stop the launch crash, which means there is some kind of linker issue, but I haven't been able to narrow it down any further yet.

Invalid Code Signing Entitlements
 
 
Q