Search code examples
iosxcodeappstore-approvalunreal-engine4ios-provisioning

ERROR ITMS-90161 Invalid Provisioning Profile


I was finally able to get my project to build in Unreal Engine on my macbook... but... Application Loader won't accept it to the App Store. I'ts an iOS app made for Distribution.

Here's What I Have

Apple Resources (image: https://i.sstatic.net/UDPzT.jpg)
- Intermediate Certificate
- iOS Distribution Certificate + Key
- App ID | Type: explicit | “com.companyName.appName”
- Provision Profile | Platform: iOS | Type: App Store
- Keychain | Intermediate Certificate + iOS Distribution Certificate + Key
- App Store Connect Project with "appName" and matching Bundle ID selected.

How I made my Certificate
- Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority… It made a CSR and key
- I used the CSR to make the iOS Distribution certificate at developer.apple.com
- Downloaded certificate, drag and dropped into the keychain I made “UnrealEngineiOS”.

Unreal Engine Settings (image: https://i.sstatic.net/nczhc.jpg)
- Provision, Certificate are valid
- Bundle Info is named exactly how I named my certificate,provision,ID. (case sensitive)
- Automatic Signing | off
- Build Configuration | Shipping

Ok so… I used that to attempt to package in Unreal on my macbook

Steps

  1. Unreal Engine > File > Package Project > iOS

    Message Log: Provision not found. A provision is required for deploying your app to the device
    Message Log: Signing key not found. The app could not be digitally signed, because the signing key is not configured

  2. Unreal Engine > Project Settings > iOS > Build > Automatic Signing | set to On
  3. Unreal Engine > Project Settings > iOS > Build > iOS Team ID | I enter my team ID
  4. Unreal Engine > File > Package Project > iOS
  5. Build Success! appName-IOS-Shipping.ipa is created.
  6. Xcode > Open Developer Tool > Application Loader | I choose my ipa file
  7. Application Loader: “Reviewing your applications...”
  8. Application Loader > Next
  9. Application Loader: “Adding application”, “verifying assets with the App Store”
  10. Application Loader error:

Error

ERROR ITMS-90161: “Invalid Provisioning Profile. The provisioning profile included in the bundle com.companyName.appName [Payload/appname.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.”

How do I get the App Store to accept my ipa file? What am I doing wrong?


Solution

  • Why it happened:

    1. Unreal Engine > Project Settings > For Distribution ☐ <-- this was not checked on therefore Unreal Engine assumes it's a development build. (I only had Build Configuration = Shipping which was not enough)
    2. Automatic Signing was checked on
      Since Unreal assumed development build it automatically used my development certificate to sign or I guess it somehow used a development provision it found from my Apple Dev online.

    Solution

    1. Turn automatic signing off
    2. Check For Distribution on

    Not sure if helpful but:

    1. I renamed my provision online then apple marked it as invalid. So I remade the provision and named it the "appName"
    2. Download provision to macbook
    3. Double click to install
    4. When open Unreal Engine you should see an Apple style provision profile ( eedfb-d1b5-45a3-b527....mobileprovision etc )
    5. Use that provision to build

    Another issue I had while resolving this:
    Unreal was still using the wrong provision to build so I deleted all the provisions it had stored and reinstalled my new one:

    On Macbook

    1. Close Unreal Engine
    2. Click Desktop to focus it
    3. Go > Go To Folder...
    4. Go to the folder: ~/Library/MobileDevice/Provisioning Profiles
    5. Delete those provisioning profiles
    6. Now you can install correct provision and certificate

    Unreal Engine should now use the provisioning profile you select rather than a random one.