xamarinxamarin.iosvisual-studio-2022code-signingprovisioning-profile

Xamarin iOS app with an extension project built on Windows VS 2022 fails signing the extension app


I have a Xamarin iOS app with an extension project (for receiving push notification) that I'm trying to upload to appstoreconnect, I'm getting invalid signature for the extension.

Visual studio 2022 on Windows 11, up to date. Mac is updated to Sequoia, Xcode version 16.4

I learned that the latest Xcode versions store provisioning profiles in a different directory. So I manually copied all profiles recently installed to the old "Library/MobileDevice/Provisioning Profiles" folder for VS 2022 to be able to read them.

I'm obviously paired with my mac and I can see the correct Signing Identity and provisioning profiles in iOS Bundle Signing tab in Project Properties, but no matter what I do the main app signs correctly but the extension app signing fails and Transporter app returns the error:

Validation failed Invalid Signature. Invalid resource directory (directory or signature have been modified). The file at path "*****/PlugIns/***Ext.appex/****Ext" is not properly signed.

I tried different provisioning profiles and certificates on developer.apple.com with different "software" types : "Apple Distribution" and "iOS Distribution"

I tried building the extension app first then the main app, still no change

I tried re-signing manually via terminal on the mac but I got even more errors

I made a dummy test app without an extension and everything seems to work just fine.

I am aware that I need to switch to MAUI. I am in no position to switch yet as there is an immediate change request. Also, I found posts with a similar issue for MAUI.


Solution

  • Found a solution that worked for me.

    1. You need to copy your .ipa files to your mac

    2. Unzip the ipa

    3. Re-sign the extension app with freshly written entitlements.plist based on your needs

    4. Re-sign the main app with freshly written entitlements.plist based on your needs

    5. Re-zip the ipa and upload it via Transporter

    Good luck !