I'm implementing continuous integration using Azure Devops and fastlane for an iOS app. It build and create the IPA file, however, when I try to upload the file after successfully creating the package I get this error message: "Invalid Provisioning Profile". This is the only distribution profile used in the app and it's working fine with Xcode, so it's valid. How to fix it?
- Change the code signing identity to automatic and manual, in both project and target. -Using manual sign in. It's currently in automatic mode.
- Provisioning profile on build settings inside Xcode, currently in automatic, was changed to Manual and set as 5c0e9419-2a5a-4905-ac99-e680efac07a5. I changed back to automatic.
- Used only the distribution certificate on the Xcode build. When I try that, there's an error in the build saying it can't find an iOS Development provisioning profile. I'm currently installing both development and distribution certificates on the pipeline build.
Here's is how I setup Azure Devops (Build Pipeline).
- master
pool:
vmImage: 'macos-latest'
steps:
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'iOSDistributionCertificate.p12'
certPwd: 'xxxxx'
keychain: 'temp'
- task: InstallAppleCertificate@2
inputs:
certSecureFile: 'iOSDevelopmentCertificate.p12'
certPwd: 'xxxxx'
keychain: 'temp'
- task: InstallAppleProvisioningProfile@1
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: '5c0e9419-2a5a-4905-ac99-e680efac07a5.mobileprovision'
- task: InstallAppleProvisioningProfile@1
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: '4e932719-f9bd-4d3e-b4e6-08b35260c632.mobileprovision'
- task: ios-bundle-version@1
inputs:
sourcePath: 'BookingApp/info.plist'
versionCodeOption: 'buildid'
versionCode: '$(Build.BuildId)'
versionCodeOffset: '0'
printFile: true
- task: Xcode@5
displayName: 'Build the app using Xcode'
inputs:
actions: 'build'
sdk: 'iphoneos12.4'
configuration: 'Release'
scheme: 'BookingApp'
packageApp: true
xcodeVersion: 10 # Options: 8, 9, 10, default, specifyPath
signingOption: 'auto'
useXcpretty: false # Makes it easier to diagnose build failures
xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'
- task: AppStoreRelease@1
inputs:
serviceEndpoint: 'Booking App Connection'
appType: 'iOS'
ipaPath: '**/*.ipa'
releaseTrack: 'TestFlight'
installFastlane: false
And here's the error message.
[17:02:55]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[17:02:56]: Sending anonymous analytics information
[17:02:56]: Learn more at https://docs.fastlane.tools/#metrics
[17:02:56]: No personal or sensitive data is sent.
[17:02:56]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
[17:02:56]: Login to App Store Connect (***)
[17:03:13]: Login successful
/usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/document.rb:44: warning: constant ::Fixnum is deprecated
[17:03:16]: Ready to upload new build to TestFlight (App: 1483789798)...
[17:03:16]: Fetching password for transporter from environment variable named `FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD`
[17:03:16]: Going to upload updated app to App Store Connect
[17:03:16]: This might take a few minutes. Please don't interrupt the script.
[17:04:09]: [Transporter Error Output]: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
[17:04:09]: Transporter transfer failed.
[17:04:09]:
[17:04:09]: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> DBG-X: parameter ErrorCode = 1102
[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> DBG-X: parameter ErrorMessage = ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal.
[17:04:09]: [iTMSTransporter] (1102)
[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> ERROR: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> DBG-X: The error code is: 1102
[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> INFO: Done performing authentication.
[17:04:09]: [iTMSTransporter] 1 package(s) were not uploaded because they had problems:
[17:04:09]: [iTMSTransporter] /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20191016-2378-s6wyrx/1483789798.itmsp - Error Messages:
[17:04:09]: [iTMSTransporter] ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> DBG-X: Returning 1
[17:04:09]: iTunes Transporter output above ^
[17:04:09]: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
Return status of iTunes Transporter was 1: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
Thanks in advance