Automated conversion of aps-environment from development to production in Xamarin
Asked Answered
F

2

13

In my Xamarin iOS project, Entitlements.plist has aps-environment set to development, for dev testing purposes. I'm using the Visual Studio Team Services Extension for the App Store to automate publishing builds to TestFlight. However, when it uses fastlane pilot to upload the app, I get this 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 'development' for key 'aps-environment' in 'project' is not supported.

It looks like the environment should get switched to production when running the continuous integration build. How do I automate this?

Flanigan answered 29/8, 2017 at 14:4 Comment(3)
What's the configuration you used to build the app (Configuration in Xamarin.iOS task)? Do you specify Provisioning Profile File for Xamarin.iOS task? What's the setting of iSO Bundle Signing (Right click project=>Properties=>iSO Bundle Signing) for that configuration? Do you select the Provisionning profile and Custom entitlements.plist correctly? You may generate a new profile and use it for that configuration. Using TestFlightMazurka
In the Xamarin.iOS task, Signing & Provisioning is set to use File Contents, but all the fields are blank. In the project's iOS Bundle Signing, Signing Identity is Developer (Automatic) or Distribution (Automatic) depending on build configuration. Provisioning Profile is Automatic. Provisioning (without push notifications) is working. Custom Entitlements is set to Entitlements.plist for both configurations. Am I supposed to fork Entitlements.plist into Entitlements.developer.plist and Entitlements.distribution.plist?Flanigan
You can try it and check the result.Mazurka
F
33

Remove Entitlements.plist, and add Entitlements.developer.plist and Entitlements.production.plist. In iOS Bundle Signing, enter the corresponding plist file for Customer Entitlements based on the build configuration.

Flanigan answered 2/9, 2017 at 15:39 Comment(3)
There's nothing about this approach in the standard template or Xamarin docs. It makes me wonder if Xamarin had a different approach in mind. It works, though.Flanigan
While removing aps-environment from Entitlements.plist will work, it will also remove Push Notification permissions from your app. Edwards solution works.Artichoke
Same problem, and same solution in VS 2022. Works great !Midpoint
L
3

I have just removed aps-environment from Entitlements.plist without adding new files and it worked for me

Legislative answered 6/11, 2019 at 21:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.