简体   繁体   中英

Ionic 4 with capacitor: xcodebuild fails with manual signing process

I'm trying to build the iOS version of an Ionic app which uses capacitor in my continuous integration system (Azure).

This is the output I get:

/usr/bin/xcodebuild -sdk iphoneos -configuration Release -workspace /Users/runner/runners/2.160.1/work/1/s/ios/App/App.xcworkspace -scheme App build CODE_SIGN_STYLE=Manual CODE_SIGN_IDENTITY=iPhone Distribution: <not_displayed> (ENT) PROVISIONING_PROFILE=5254b426-4af0-45e7-aeab-ec63a303d250 PROVISIONING_PROFILE_SPECIFIER=

Build settings from command line:
CODE_SIGN_IDENTITY = iPhone Distribution: swiss1mobile ag (ENT)
CODE_SIGN_STYLE = Manual
PROVISIONING_PROFILE = 5254b426-4af0-45e7-aeab-ec63a303d250
PROVISIONING_PROFILE_SPECIFIER = 
SDKROOT = iphoneos13.1

note: Using new build system
note: Planning build
note: Constructing build description
error: Capacitor does not support provisioning profiles. Capacitor does not support provisioning profiles, but provisioning profile ent_frontwork has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'Capacitor' from project 'Pods')
error: CapacitorCordova does not support provisioning profiles. CapacitorCordova does not support provisioning profiles, but provisioning profile ent_frontwork has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'CapacitorCordova' from project 'Pods')
error: Pods-App does not support provisioning profiles. Pods-App does not support provisioning profiles, but provisioning profile ent_frontwork has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'Pods-App' from project 'Pods')

** BUILD FAILED **

I've been searching a lot but no luck. Any clue?

A little workaround fixes this problem. I found this issue in Github for a similar error caused by an update in cocoapods. I find it a bit hacky, but it works. I'm not sure if Azure should fix its xcode task to avoid these errors, but for now, this is good enough.

So the fix is just adding this code to the Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
      config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
      config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
    end
  end
end

This way the pods don't have to be signed, and the error is not shown anymore and the app is built.

Follow the below steps if your Xcode version in 11.0 or above.

1.Navigate to the application.

2.Select " Signing & Capabilities ".

3.Click " Enable Development Signing "

Credit: Jacksonsox

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM