Ashwin
Ashwin

Reputation: 363

XCode expects development certificate when trying to distribute app built on Flutter. ERROR ITMS-90161

XCode expects a development certificate with my provisioning profile when I am actually trying to do a distribution.

More details

I am trying to push an update to an iOS app on app store, that was initially built by another developer using Flutter. Using flutter build ipa and uploading the archive through XCode simply never worked, it always got stuck in the uploading screen. So I tried Transporter after getting an ipa with flutter build ios --release [1]. Using automatic signing so far, Out of almost 50 tries, only one went through for some reason. The rest of the time I see the following error.

ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle com.spoonmoney.app [Payload/Runner.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." 

Transporter error while uploading Transporter Details of automatic signing Automating signing includes development certificate

When I try to do manual signing with a valid provisioning profile which includes distribution cert, Xcode shows this error:

Manual signing error Details of profile enter image description here

Things to note

Upvotes: 2

Views: 4397

Answers (1)

Vandad Nahavandipoor
Vandad Nahavandipoor

Reputation: 1574

So you have just stumbled upon this black hole that I've also stumbled upon before and the only steps that have helped me are the followings:

  1. Go to your development portal and remove all certificates and profiles.
  2. Go to your Keychain Access on your computer and remove all certificates (Create a backup before you do this. Put the backup in a ZIP file)./
  3. Go to Xcode and in your project remove all settings related to profiles and certificates by selecting them and then pressing Backspace.
  4. Delete all provisioning profiles on your computer under this folder ~/Library/MobileDevice/Provisioning Profiles/
  5. Generate a new certificate request in Keychain Access.
  6. In Developer Portal, create a new Distribution certificate using your certificate request.
  7. Download the newly-generated certificate and double click to install it in your Keychain Access.
  8. In Developer Portal, create a new App Store profile for your newly generated certificate and download it.
  9. After downloading the profile, manually place it in the ~/Library/MobileDevice/Provisioning Profiles/ folder. If you double click on a provisioning profile to install it, it loses its actual name and changes the name to its UUID making it undistinguishable from other profiles. So manually place the downloaded profile in ~/Library/MobileDevice/Provisioning Profiles/
  10. Quit Xcode completely
  11. Go back to Xcode and set up your profiles and certificates and make sure you're not doing automatic signing
  12. Clean your Xcode project
  13. Build again and you should be good to go

Upvotes: 3

Related Questions