0

My app compiles and archives fine, but on upload to the Apple store it fails with the following error message:

Prepared archive for uploading Upload failed error: App Store Connect Operation Error ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, value 'WF3BGN675V.net.brian-fitzgerald.changes' for key 'application-identifier' in 'Payload/I-Ching.app/Watch/watchkitapp.app/watchkitapp' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier."

and

error: App Store Connect Operation Error ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, value 'WF3BGN675V.net.brian-fitzgerald.changes' for key 'application-identifier' in 'Payload/I-Ching.app/Watch/watchkitapp.app/PlugIns/watchkitapp Extension.appex/watchkitapp Extension' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier."

But the string displayed IS my TeamID followed by a dot followed by the bundle identifier!!! Or is it expecting the bundleidentifier for the watchkit? Because if so it's not taking it from the info.plist file for the watchkit app, where it's assigned to net.brian-fitzgerald.changes.watchkitapp

info.plist watchkitapp

info.plist for watchkitappextension

I've spent hours trying varying everything I can in signing authorities and provisioning profiles, fiddling with the bundle id hierarchies, cleaning and rebuilding and recleaning. The only results I get are a failure to build or a successful build with this message.

I've seen many other posts about other ITMS-90046 errors but nothing involving the watchkitapp and extension not reporting the proper team & bundle syntax.

What am I missing?

UPDATE: Following @Help's advice I regenerated my entitlements files by deleting the files themselves, and the paths to them from the project plist.

The problem persists but with a different error message:

enter image description here

And again there's no mismatch between the plist bundle identifier and the identifier in the provisioning profile. My Entitlements-Release.plist is:

 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>application-identifier</key>
 <string>WF3BGN675V.net.brian-fitzgerald.changes</string>
 <key>aps-environment</key>
 <string>production</string>
 <key>com.apple.security.application-groups</key>
 <array>
 <string>group.net.brian-fitzgerald.changes</string>
 </array>
</dict>
</plist>
asked Dec 12, 2019 at 22:06
3
  • Just delete the entitlements and then run the app again . A new entitlement file will be added with the current build setting selected. Commented Dec 13, 2019 at 4:58
  • Build fails: "error: The file "Entitlements-Debug.plist" couldn’t be opened because there is no such file." Commented Dec 13, 2019 at 7:28
  • I deleted the entitlement file and the path to the file in the project info.plist, and that re-generated the entitlement file. But now I get a different error, updating my question above. Commented Dec 14, 2019 at 12:54

2 Answers 2

1

Found it. Literally days wasted on this, I hope this saves someone else some pulled hair.

The info.plist is not the only place the Watchkit and Watchkit Extension bundle identities are assigned. There's a bundle identifier key in Build Settings for the watchkit app and watchkit extension targets: no matter what you put in your info.plist, these are the ones that the provisioning profile looks at for a match:

enter image description here

Either those keys are new in Xcode 11 or they were always mis-set in my app. If the latter, I suspect the behaviour described here in the release notes for 11 was the culprit:

Xcode removes some entries from the Info.plist file of a product at build time if the entries are not appropriate for the platform being built for, which is useful for targets which are configured to build for multiple platforms. This behavior can be disabled by setting the build setting DISABLE_INFOPLIST_PLATFORM_PROCESSING to YES, in which case the target must assume the responsibility of managing these entries appropriately. (47797497)

To be clear, I did not set that key, but by setting the bundle identifier in the Watchkit to

net.brian-fitzgerald.changes.watchkitapp

and in the extension to

net.brian-fitzgerald.changes.watchkitapp.watchkitextension

I was able to assign the provisioning profiles with those identities to the targets and build and upload normally.

I have never been so happy to see the big green check mark for a successful upload. I thought my app was toast. If my analysis is correct, I hope Apple documents this one in the next release notes. I can't be the only one who will face this, and the log trail is pure misdirect.

answered Dec 16, 2019 at 7:41
Sign up to request clarification or add additional context in comments.

Comments

1

For others with the same issue -- was running an adhoc build to AppCenter and there were non-updated bundle id settings in the MY-Project-Enterprise-archive-exportOptions.plist file. So make sure you update those as well.

Also the provisioning profile name is what appears when you Quick Look on the profile and/or how Xcode displays it, not what the file name is. I.E. profile filename is "Enterprise_Watch_App_Distribution.mobileprovision" but it actually says its "Enterprise Watch Distribution" (no App) go with the no App name (the latter) there.

Example:

Key: com.yourproject.ent.watchkit.widgetextension
Value: YourProject Enterprise Watch Distribution
answered Feb 26, 2024 at 21:44

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.