63

App is already submitted to App Store from xcode-9 and now I have to update new version.But now xcode is updated i.e.xcode 10.During Validating it shows 'Apps must contain a provisioning profile in a file named embedded.mobileprovision..' .App is working fine on simulator

Even I have downloaded provisioning certificated.

developer.PT
  • 660
  • 1
  • 5
  • 11

6 Answers6

175

I tried to clear out the provisioning profiles and none of it did help. What changed from the previous XCode version to this one is the build system. By changing your build system back to the legacy one, this was resolved for me.

You can switch out the build system under file > workspace settings (or project settings) and then select Legacy Build System under Build System (see screenshot).

select build system under preferences

Edit: As of cordovo iOS 5.0.0 the new build system is now supported. Changelog can be found over here: https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html

starball
  • 20,030
  • 7
  • 43
  • 238
Luuk Schoenmakers
  • 1,814
  • 1
  • 8
  • 5
  • Thanks.but After doing that showing 'App Store Connect Operation Error:Invalid App Store Icon. The App Store Icon in the asset catalog in 'app_name.app' can't be transparent nor contain an alpha channel.' Even I have update icon which do not contain an alpha channel.What to do??Please help! – developer.PT Sep 24 '18 at 08:08
  • Thanks again..For below error I changed icon from Xcode-AppIcon-appstore-1024pt. without contain alpha channel and validate successfully. – developer.PT Sep 24 '18 at 08:23
  • 4
    Luuk - you are the Man!!! I lost a whole weekend over that bug. developer.PT - I fix that with imagemagik (find ./resources/ -name "*.png" -exec convert "{}" -alpha off "{}" \;) – Chris Skura Sep 25 '18 at 04:07
  • 1
    Thank you this problem was hitting me too. – Hiago Souza Oct 01 '18 at 23:34
  • 3
    a month ago my iOS app submit process to production worked fine ... then I allowed the recent XCode upgrade to happen then above issue happened - your suggestion worked however now iconnect fails to see the app I successfully submitted from XCode - apple may be a trillion dollar business however they invest zilch back into their app store delivery process - its always been a shit show in comparison to Android - Dear Apple get your act together ... can't wait for a fully linux mobile alternative - and when it comes Apple will shrivel up and disappear ... remember Nokia ? I thought not – Scott Stensland Oct 03 '18 at 21:25
  • 4
    This works great, but what if I want to use the new build system? How can I get the provisioning profile into the build? – Ty Le Dec 19 '18 at 00:22
14

If running/building from the CLI, use this command to use the legacy build system instead of the new one

cordova build ios --buildFlag="-UseModernBuildSystem=0"
jcesarmobile
  • 51,328
  • 11
  • 132
  • 176
6

You can also create a new build.json file at the root of your cordova project, if you don't already have one, and add the following json data. This basically tell the build process for "ios" to use the legacy build system. It will automatically add the build flags in the build.json file to your build command e.g. cordova build ios --prod will also run as though it was typed as cordova build ios --prod --buildFlag="-UseModernBuildSystem=0".

{
    "ios": {
        "debug": {
            "buildFlag": [
                "-UseModernBuildSystem=0"
            ]
        },
        "release": {
            "buildFlag": [
                "-UseModernBuildSystem=0"
            ]
        }
    }
}
3

Clean your build (Cmd + Shift + K). Quit XCode (don't just close the project, make sure XCode has completely quit).

Delete everything in the ~/Library/MobileDevice/Provisioning Profiles folder.

Re-start XCode and load your project.

If you have XCode set to Automatically Manage Signing, you should be able to select your team and then it should re-download your provisioning profiles for you. If you don't, you'll have to manually download them from your Apple Developer account and then select "import" from the Debug signing dropdown and the Distribution signing dropdown.

If you then try to run the app on a device and you get a "Valid Provisioning Profile cannot be found for this executable" you need to go to Window | Devices & Simulators. Find your device on the left side of the window, ctrl+click on it, select "See Provisioning Profiles". Click on each individual profile and click the minus sign at the bottom. When the list is empty, click on the plus sign to add a new one, then find the profiles you downloaded and import each of them, one at a time to that list.

That should hopefully fix any provisioning profile issues that XCode is giving you.

Good luck!

3

If you have the above problem and it is being solved by switching to legacy build system. The alternative with new (default) build system is to to manual signing.

When uploading or validating your archive pick 'manual' option and select your Team and download the provisioning profile. (Or import after a download from the developer portal).

Mark
  • 31
  • 1
  • This and the above answer together solved my issue: Clean the build, delete the files in the Provisioning profiles folder then re-open the project, set up signing again on the project page and then when validating the archive I selected manual signing, downloaded the provisioning profile and finally it validated successfully. – Lippai Zoltan Nov 28 '18 at 14:26
0

I created a new provisioning profile and selected "Manually Manage Signing" and selected the profile I had manually created.

It then complained about missing a 1024x1024 icon which I fixed with this answer: Missing App Store Icon. iOS Apps must include a 1024x1024px App Store > Icon in PNG format

user3413723
  • 11,147
  • 6
  • 55
  • 64