Uploading failed with ERROR ITMS-90045: Invalid Code Signing Entitlements

Presentation

I've an Apple Dev ID as a member of an organisation.
I use Visual Studio 2019 on Windows 10 to build the ipa file via the Mac using Xcode version 11.2.1.
The ipa file is uploaded to the store using Fastlane by the administrator of the same organisation.

DESCRIPTION OF PROBLEM

We've this problem when uploading ipa file on the store.
With the developer provisioning profile, I can execute my app without problem.

But with the distribution provisionning profile created by the administrators, when they upload the ipa file,
we have the errors above. The distribution provisionning profile is generated by them with the iCloud option Include Cloudkit support (requires Xcode 6).


As a member, I download the profile on the Mac and double-click on it to load it in Xcode.

In order to see the profile in question in Visual Studio 2019, I download the profile from Xcode and build the ipa file with the
configuration Ad-Hoc, the only one that I can use with the profile provided.


In the Entilements file, I only have these two lines :
1)
<key>com.apple.developer.icloud-container-environment</key>
<string>Production</string>.


Or with all these features declared in Entitlements file :
2)
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.[mycompnay].[myapp]</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
<string>CloudKit</string>
</array>

When uploading the ipa file, we always have the same errors having 1) or 2) in the Entitlements file:


ERROR ITMS-90045: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements
that are not supported on iOS.
Specifically, key 'com.apple.developer.icloud-container-development-container-identifiers' in 'Payload/MyCompnayMyApp.app/MyCompnayMyApp' is not supported."

ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements
that are not supported on iOS.
Specifically, value '*' for key 'com.apple.developer.icloud-services' in 'Payload/MyCompnayMyApp.app/MyCompnayMyApp' is not supported."

ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements
that are not supported on iOS.
Specifically, value 'Development' for key 'com.apple.developer.icloud-container-environment' in 'Payload/MyCompnayMyApp.app/MyCompnayMyApp' is not supported."

ERROR ITMS-90211: "Invalid Code Signing Entitlements. The signature for your app bundle contains entitlement values
that are not supported. For the com.apple.developer.ubiquity-kvstore-identifier entitlement, the value must start with the prefix provided by Apple in the provisioning profile, followed by characters that are uppercase or lowercase Roman letters [A-Z, a-z], the digits 0 through 9, dot ['.'], or hyphen ['-'], and not contain any wildcard characters. Specifically, value 'AN8YKZK4DA.*' for the key 'com.apple.developer.ubiquity-kvstore-identifier' in 'Payload/MyCompnayMyApp.app/MyCompnayMyApp' is not supported."

ERROR ITMS-90045: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements
that are not supported on iOS.
Specifically, key 'com.apple.developer.icloud-container-development-container-identifiers' in 'Payload/MyCompnayMyApp.app/MyCompnayMyApp' is not supported."

ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements
that are not supported on iOS.
Specifically, value '*' for key 'com.apple.developer.icloud-services' in 'Payload/MyCompnayMyApp.app/MyCompnayMyApp' is not supported."

ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements
that are not supported on iOS.
Specifically, value 'Development' for key 'com.apple.developer.icloud-container-environment' in 'Payload/MyCompnayMyApp.app/MyCompnayMyApp' is not supported."

ERROR ITMS-90211: "Invalid Code Signing Entitlements. The signature for your app bundle contains entitlement values
that are not supported. For the com.apple.developer.ubiquity-kvstore-identifier entitlement, the value must start with the prefix provided by Apple in the provisioning profile, followed by characters that are uppercase or lowercase Roman letters [A-Z, a-z], the digits 0 through 9, dot ['.'], or hyphen ['-'], and not contain any wildcard characters. Specifically, value 'AN8YKZK4DA.*' for the key 'com.apple.developer.ubiquity-kvstore-identifier' in 'Payload/MyCompnayMyApp.app/MyCompnayMyApp' is not supported."


Questions:


What did we do wrong?
Can a member of an organisation build an ipa file via Xcode which will be uploaded by an administrator of the same organisation using Fastlane?

STEPS TO REPRODUCE
Each time, the ipa file is uploaded with Fastlane.

Replies

I'm seeing the same errors, how did you solve it?
I fixed this issue by following this:

forums.expo.io/t/uploading-ios-app-to-test-flight-error-invalid-code-signing-entitlements/39340

Overall, the problem is there is mismatch/lack of capabilities between Identifier(https://developer.apple.com/account/ -> Certificates, IDs, & Profiles -> Identifiers -> click your app identifier -> click the related checkbox) and your build. Just ensure that you configure and set them correctly for both.

I tried yours but it never worked

Hello friend, I had the same error when using the compilation with fastlane. try the following step: In Apple Account --> Certificates, Identifiers & Profiles --> Identifiers Click on your app's Identifier. In the list of services, uncheck Game Center as in the image and save. Generate the project and provisioning profile again.