cordova-ios: Provisioning Profile not setup correctly with new build system

Building with the CLI: cordova build ios --device --codeSignIdentity="iPhone Developer" --provisioningProfile="NAME" --developmentTeam="TEAMID"

after upgrading to cordova-ios 5.0.0, the following error occurs:

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: "[app-name]" requires a provisioning profile with the Push Notifications feature. Select a provisioning profile for the "Debug" build configuration in the project editor. (in target '[app-name]')

Build system information
warning: The iOS deployment target is set to 4.3, but the range of supported deployment target versions for this platform is 8.0 to 12.1. (in target 'nanopb')

Build system information
warning: The iOS deployment target is set to 7.0, but the range of supported deployment target versions for this platform is 8.0 to 12.1. (in target 'Protobuf')

i am using a provisioning profile which contains an entitlement and my project also has the aps-entitlement.

cordova-ios 4.5.5 build fine.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 10
  • Comments: 40 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Update: Still an issue with latest cordova-ios 6.1.0, must use UUID rather than profile filename to automate build process, which is frustrating when provisioning profile changes such as adding new devices.

I’m getting a similar error when I build an ad-hoc, manually signed build with Xcode 10.1, iOS Cordova 5.0.0.

error: "[app-name]" requires a provisioning profile. Select a provisioning profile for the "Release" build configuration in the project editor. (in target '[target]')

I can work around this by opening the project in Xcode, and re-selecting the provisioning profile. After that, subsequent cordova CLI builds will build and archive just fine, until I delete the directory in which the xcodeproj lives. It’s weird because Xcode shows the profile’s name as selected, but it requires you manually re-select it from the drop down list.

Unfortunately this breaks my CircleCI builds which are building for my ad hoc devices.

Automatic provisioning works fine for my Debug builds.

I am running into something similar, does your generated exportOptions.plist contain a provisioningProfile key which is wrapped with double quotes, like this:

<key>provisioningProfiles</key> <dict> <key>"A1B2C3D4.com.test.app"</key> <string>j23k4234-lk23423-adsa-adads-asdadasd</string> </dict>

Don’t know how relevant it is to you by now but i solved the problem by changing the build.json file like this (cordova-ios v6.2.0) when using cordova build ios :

{ “ios”: { “debug”: { “buildFlag”: [ “PROVISIONING_PROFILE_SPECIFIER=Provisioning_profile_name”, “CODE_SIGN_STYLE=Manual” ], “codeSignIdentity”: “iPhone Developer”, “developmentTeam”: “XYZ”, “packageType”: “development”, “provisioningProfile”: “Provisioning_profile_name” } } }

The same works with release version or/and ad-hoc profile.

  • PROVISIONING_PROFILE_SPECIFIER specifies which PP should xcodebuild use by providing the PP name (not UUID)
  • CODE_SIGN_STYLE has to be specified to “Manual”, if not xcdebuild wants to use automatic signing and it throws an error
  • provisioningProfile should still be defined when using --device

@pepenemo Automatic signing is usually easier if you have access to the same Mac. To set up automatic signing for me has usually involved doing something interactively within Xcode at least once before the cordova build will work eg unchecking and checking the “automatically manage signing” box.

I had to use manual signing for my Travis build which sets up a Mac virtual machine for each build. I used several helpful articles online to get my Travis script in place: https://github.com/Freegle/iznik-nuxt/blob/app-ios/.travis.yml This script build adhoc and app-store version of two apps (from the one source), saves the generated IPAs in a github release and uploads the release IPAs to iTunes.

I got a second hand Macbook Air (2013) which runs the latest MacOS Catalina 10.15 that runs Xcode 11.4.1. The Travis VM runs MacOS Mojave 10.14.6 with Xcode 11.3.1.

Xcode 10 is what cordova supported and was tested against. Xcode 11 requirement is not a cordova requirement but an Apple requirement if you want to deploy to the iOS app store. The reason for the disconnect is not all developers build for the app store, we do have users who build apps for enterprise/in-house installations. While not explicitly mentioned in the readme, cordova-ios does work in xcode 11.

In regards to your issue at hand, I cannot really provide a comment. I let Xcode automatically manage the signing and provisions and that has always worked for me. Sometimes I need to uncheck and re-check that “automatically manage signing” box however.

@dpogue I’ve tested with a UUID instead of a name and it works for me. My fix might have been what’s been necessary all along to fix this issue, but it would be good if others could test it.

I’ve done a first Apache Cordova PR here - let me know if you need an ICLA done etc. https://github.com/apache/cordova-ios/pull/823

Here is the workaround for now: use the UUID instead of the profile provision name https://github.com/apache/cordova-ios/issues/625