Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to distribute with Xcode 10 #412

Closed
neofuture opened this issue Sep 18, 2018 · 58 comments
Closed

Unable to distribute with Xcode 10 #412

neofuture opened this issue Sep 18, 2018 · 58 comments

Comments

@neofuture
Copy link

When trying to push a project to app store with Xcode 10 i get the following new error

ERROR ITMS-90174: "Missing Provisioning Profile - Apps must contain a provisioning profile in a file named embedded.mobileprovision."

@janpio janpio added the support label Sep 18, 2018
@janpio
Copy link
Member

janpio commented Sep 18, 2018

Push how?
Who exactly outputs that error when?
How did you build the project? (Do you have the complete build output?)
Did this exact project work before upgrading to Xcode 10?

@neofuture
Copy link
Author

Project was opened in Xcode 10, built then Distributed from the Xcode10 organiser, the project worked fine with Xcode 9 without any changes. i dont have build output as i have to use Xcode to build

@janpio janpio added the bug label Sep 18, 2018
@janpio
Copy link
Member

janpio commented Sep 18, 2018

Right now we only have workaround for builds with the CLI published over at #407. You might need some instructions on how to get a Xcode only project to work. Someone will have to look into this.

@janpio janpio removed the support label Sep 18, 2018
@neofuture
Copy link
Author

Yes, i have just built with CLI and it built and ran in simulator but i need to distribute to the app store and cant without Xcode, so cant put anything onto test flight.

@neofuture
Copy link
Author

I was going to try and use the CLI and create the app store package and use application loader ive tried

cordova build ios --buildFlag="-UseModernBuildSystem=0" --packageType="app-store"

but i only get the normal .app file in the emulator folder which application loader will not deal with

@dpogue
Copy link
Member

dpogue commented Sep 18, 2018

Try cordova build ios --release --device --buildFlag="-UseModernBuildSystem=0" --packageType="app-store"

@sufian4199
Copy link

Facing the same issue.

ionic cordova build ios --buildFlag="-UseModernBuildSystem=0" allows you to make the build. However not able to submit it to the store. It gives the same error as @neofuture mentioned

@sufian4199
Copy link

cordova build ios --release --device
Discovered plugin "call-number" in config.xml. Adding it to the project
Plugin "mx.ferreyra.callnumber" already installed on android.
Plugin "mx.ferreyra.callnumber" already installed on ios.
Building project: /Users/muhammadsufian/Documents/GITREPOS/driveit/userApp/platforms/ios/DriveIt.xcworkspace
Configuration: Release
Platform: device
User defaults from command line:
IDEArchivePathOverride = /Users/muhammadsufian/Documents/GITREPOS/driveit/userApp/platforms/ios/DriveIt.xcarchive

Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/muhammadsufian/Documents/GITREPOS/driveit/userApp/platforms/ios/build/device
SHARED_PRECOMPS_DIR = /Users/muhammadsufian/Documents/GITREPOS/driveit/userApp/platforms/ios/build/sharedpch

Build settings from configuration file '/Users/muhammadsufian/Documents/GITREPOS/driveit/userApp/platforms/ios/cordova/build-release.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
CODE_SIGN_IDENTITY = iPhone Distribution
ENABLE_BITCODE = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseCore/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" "${PODS_ROOT}/FirebaseMessaging/Frameworks"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/FirebaseMessaging" "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/nanopb"
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac" "${PODS_CONFIGURATION_BUILD_DIR}/Protobuf" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb"
OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseCore" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/FirebaseMessaging" -isystem "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" -isystem "${PODS_ROOT}/Headers/Public/Protobuf" -isystem "${PODS_ROOT}/Headers/Public/nanopb"
OTHER_LDFLAGS = $(inherited) -ObjC -l"GoogleToolboxForMac" -l"Protobuf" -l"c++" -l"nanopb" -l"sqlite3" -l"z" -framework "AddressBook" -framework "FirebaseAnalytics" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseInstanceID" -framework "FirebaseMessaging" -framework "FirebaseNanoPB" -framework "StoreKit" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h

error: archive not found at path '/Users/muhammadsufian/Documents/GITREPOS/driveit/userApp/platforms/ios/DriveIt.xcarchive'
** EXPORT FAILED **

(node:17836) UnhandledPromiseRejectionWarning: Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,DriveIt.xcarchive,-exportOptionsPlist,/Users/muhammadsufian/Documents/GITREPOS/driveit/userApp/platforms/ios/exportOptions.plist,-exportPath,/Users/muhammadsufian/Documents/GITREPOS/driveit/userApp/platforms/ios/build/device
(node:17836) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:17836) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@dpogue even this does not solve the signing issue

@neofuture
Copy link
Author

That created the IPA fine, but... application loader can not connect to the app store anymore so thats that one scuppered, i can see a lot of frustration from todays Xcode 10 auto update as no one will now be able to publish there app

@neofuture
Copy link
Author

Temporary Fix: I went back to Xcode 9.4.1 from he developer downloads at developer.apple.com, reopened the project with this and was able to upload to the app store.

For notice: I was previously building the project with Xcode Beta (i like the black theme) and was using Xcode 9 for uploading to app store. i have no problems building in Xcode 10 my only issue is distribution to the app store.

@mlegenhausen
Copy link
Contributor

I used fastlane deliver today for uploading two apps build with Xcode 10 without problems. The only thing that needed to be changed so the signing was working was to change the ProvisioningStyle to Manual in all project.pbxproj files. Then you can set your codeSignIdentity and provisioningProfile via your build.json.

sh.sed(
    '-i',
    /ProvisioningStyle = Automatic/,
    'ProvisioningStyle = Manual',
    'platforms/ios/**/project.pbxproj'
  );

@sufian4199
Copy link

@neofuture i was able to submit app via xcode but now instead of wildcard i had to create an individual provisioning profile for each app. However after that everything worked as expected.

@pliablepixels
Copy link

@sufian4199 how did you submit app? Are you still using Xcode 10? I am able to build with ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0" but when I archive via Xcode 10 and try to validate it, I am stuck with the missing mobile provision error.

@sufian4199
Copy link

sufian4199 commented Sep 18, 2018

@pliablepixels yes i am submitting via xcode 10. I did the following things

  1. Created provisioning profile in my developer account for that app id.
  2. Downloaded and added that profile in my Xcode (simply double click the downloaded profile)
  3. Instead of auto signing the code i used manual and used that specific provisioning profile and all went well

PS: I however dont know why this happened because auto signing was working perfectly for me on xcode 9. However doing this gets the job done 👍

@kitolog
Copy link

kitolog commented Sep 18, 2018

I got the same issue using Xcode 10
I cannot also distribute the latest build via Fabric or run ios app using cli
Xcode 10
iOS 12
macOS 10.13.6
Ionic 3.20.0
Cordova 8.0.0
cordova-ios 4.5.5

Build using ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0" does not solve the problem with Fabric distrubution

Running with
ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0" works fine

@pliablepixels
Copy link

pliablepixels commented Sep 18, 2018

@sufian4199 - I can confirm your solution works. To summarize the hacks so far:

  1. While building, we need to do (if using ionic) ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
  2. When you open it in Xcode, you can continue using "Automatic Sign" for the project, but when you upload the archive to App Store (for TestFlight or App Store) , you need to select "manually manage signing". When you select manual signing you will see there is no associated provisioning profile (huh...) so select one, and the right distribution profile.

I've managed to upload and distribute successfullly.

@sufian4199
Copy link

@pliablepixels thank you for summarising it in the best possible way 👍

@dpogue
Copy link
Member

dpogue commented Sep 18, 2018

@pliablepixels @mlegenhausen Thanks for providing more information to help us understand what's going on! I might be missing something, but it seems like it's unclear whether this is an Xcode issue with automatic signing, or a Cordova issue with how we set up the automatic signing.

Could you help fill in this table?

Export with
Automatic Signing
Export with
Manual Signing
Xcode IDE
Cordova/Ionic CLI
Bonus Info:
Fastlane CLI
Table Markup for copy/paste
|                               | Export with<br>Automatic Signing | Export with<br>Manual Signing |
|-------------------------------|----------------------------------|-------------------------------|
| Xcode IDE                     |                                  |                               |
| Cordova/Ionic CLI             |                                  |                               |
| *Bonus Info:*<br>Fastlane CLI |                                  |                               |

@rossholdway
Copy link

rossholdway commented Sep 18, 2018

@dpogue From my testing... others should probably confirm :)

Export with
Automatic Signing
Export with
Manual Signing
Xcode IDE Export will succeed, but won't validate due to missing profile (embedded.mobileprovision) Export will succeed, validation will succeed
Cordova/Ionic CLI Works, but only if run with UseModernBuildSystem=0 (this also seems to trigger the initial generation of the Xcode managed profiles). Works, manually specifying the distribution profile.
Bonus Info:
Fastlane CLI

@dpogue
Copy link
Member

dpogue commented Sep 18, 2018

hmm, that confuses me a bit because everyone seems to be saying that Cordova with automatic signing is resulting in the error about missing embedded.mobileprovision.

@pliablepixels
Copy link

pliablepixels commented Sep 18, 2018

@dpogue - I'm new to the cordova command line "build for release" process so I'm not sure I'm doing what you need. It looks like I can't install an ipa signed for the app store manually, so I am doing it using an adhoc profile. Does that help or do you specifically need build type = app-store? Please let me know before I do the manual sign test on cli

Tests with adhoc profile

Export with
Automatic Signing
Export with
Manual Signing
Xcode IDE Export will succeed, will not install due to missing profile Export will succeed, and will successfully install
Cordova/Ionic CLI build will succeed, install also succeeded irrespective of whether modernbuildsystem is disabled or enabled (1)(2) (tbd)

(1) CLI build command:

ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0" --buildConfig="./build.json" --release
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=1" --buildConfig="./build.json" --release

(2) Something has changed since I attempted in the morning and now. Whilst a simple ionic cordova build iOS would fail in the morning, it now prints a "platform not found" but doesn't error out. It completes the build. See my followup

My build.json

@dpogue
Copy link
Member

dpogue commented Sep 18, 2018

@pliablepixels I assume that ad-hoc or app-store (or even enterprise) would be fine... It has to sign the build in all cases.

Maybe I'm confused about this issue... is there a problem wherein Cordova CLI is making builds with missing embedded mobileprovision files, or is the issue that Xcode makes builds with missing profiles when exporting Cordova projects? I guess we need more information from @neofuture about which export process was being used

@pliablepixels
Copy link

pliablepixels commented Sep 18, 2018

I'm completely confused as well, so I'll retract and wait for others more qualified than me to report, so as not to confuse you. In the morning, a simple ionic cordova build ios would fail with a platform not found error, while a build within Xcode 10 would work, but now, in the evening I see the same error message, but it continues to build and export. I don't quite follow the CLI process well, so I think its best we wait for folks who know what they are doing :-)

In the morning:

{PODS_ROOT}/Headers/Public/FirebaseCore" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/FirebaseMessaging" -isystem "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" -isystem "${PODS_ROOT}/Headers/Public/Protobuf" -isystem "${PODS_ROOT}/Headers/Public/nanopb"
    OTHER_LDFLAGS = $(inherited) -ObjC -l"GoogleToolboxForMac" -l"Protobuf" -l"c++" -l"nanopb" -l"sqlite3" -l"z" -framework "AddressBook" -framework "FirebaseAnalytics" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseInstanceID" -framework "FirebaseMessaging" -framework "FirebaseNanoPB" -framework "StoreKit" -framework "SystemConfiguration"
    PODS_BUILD_DIR = $BUILD_DIR
    PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
    PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
    PODS_ROOT = ${SRCROOT}/Pods
    SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h

2018-09-18 17:51:25.569 xcodebuild[60657:1388992]  DTDeviceKit: deviceType from 8a7f8ff88e79aca165c1f88cc6770c3447630a03 was NULL
2018-09-18 17:51:25.569 xcodebuild[60657:1388992]  DTDeviceKit: deviceType from 8a7f8ff88e79aca165c1f88cc6770c3447630a03 was NULL
2018-09-18 17:51:25.570 xcodebuild[60657:1388992]  iPhoneSupport: 📱<DVTiOSDevice (0x7f96c8d034b0), PP iPhone X, iPhone, 12.0 (16A366), 83f9f3a76dac77d2afe8a2acc9a14a8ec96d1f34> unable to mount DeveloperDiskImage (Error Domain=com.apple.dtdevicekit Code=601 "Could not findplatform" UserInfo={NSLocalizedDescription=Could not find platform})

It would fail around here

But now, it prints the above message and continues on to:

2018-09-18 17:51:26.268 xcodebuild[60657:1388881] [MT] DTDeviceKit: deviceType from 8a7f8ff88e79aca165c1f88cc6770c3447630a03 was NULL
2018-09-18 17:51:26.297 xcodebuild[60657:1388881] [MT] DTDeviceKit: deviceType from 8a7f8ff88e79aca165c1f88cc6770c3447630a03 was NULL
2018-09-18 17:51:26.353 xcodebuild[60657:1388881] [MT] DTDeviceKit: deviceType from 8a7f8ff88e79aca165c1f88cc6770c3447630a03 was NULL
2018-09-18 17:51:26.386 xcodebuild[60657:1388881] [MT] DTDeviceKit: deviceType from 8a7f8ff88e79aca165c1f88cc6770c3447630a03 was NULL
Non-system Ruby in use. This may cause packaging to fail.
If you use RVM, please run `rvm use system`.
If you use chruby, please run `chruby system`.

2018-09-18 17:51:29.005 xcodebuild[60669:1389142] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/rn/110mft9515v2q5bgzk4jwgjc0000gn/T/zmNinja_2018-09-18_17-51-28.998.xcdistributionlogs'.
Exported zmNinja to: /Users/pp/projects/phonegap/zmNinja/platforms/ios/build/device
** EXPORT SUCCEEDED **
 

@neofuture
Copy link
Author

I use Cordova to create the project, but then I roll over to Xcode to increase versions, and upload to App Store via the organiser, I can build to emulator with the CLI but this is not ideal because version and build is reset to 1.0.0 each time and I maintain this in Xcode, I have since gone back to Xcode 9.4.1 with the exact same project and it builds from within Xcode and I can distribute (have the binary waiting for review now)

if I distribute with Xcode 9.4.1 it does not complain about the missing provisioning, if I distribute with Xcode does, but this could be down to changes in the project files and that file being missing for the new style of build

@neofuture
Copy link
Author

"is there a problem wherein Cordova CLI is making builds with missing embedded mobileprovision files"

I can't confirm as the version numbers are all wrong in the build so I can't use application loader to push it up, but could it be the default required embedded mobileprovision should be in the Cordova iOS platform project and Xcode, not finding it, doesn't include it ?

@kitolog
Copy link

kitolog commented Sep 19, 2018

Huh
I did it, so, for Ionic developers (and plain Cordova too) to solve problems with AppStore and Fabric

  1. To build in console
    ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
  2. To run in console
    ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
  3. To build archive using Xcode:
  • setup provisioning profile, certificates, etc. That's no matter using automatic or manual signing, do it habitual way as previously
  • In the Xcode, open Workspace Settings -> Build System -> and select Legacy Build System

Using Legacy Build System you will be able to build archive with normal mobileprovision and Info.plist files

2018-09-19 9 08 46

2018-09-19 9 09 03

@Stefano1964
Copy link

The new build system it's not failing in Xcode.

@Stefano1964
Copy link

With command line it's failing because the provisioning profile it's not included in the build not because of the new build system, otherwise this wont work in Xcode too.

@dpogue
Copy link
Member

dpogue commented Sep 19, 2018

This is where I'm getting a bunch of contradictory information in these comments. Several people have said that the Cordova CLI is able to make successful builds with the provisioning profile included when using the -UseModernBuildSystem=0 flag. Others have now said that it also works in Xcode after changing the build system preference in the Xcode UI.

So is this an accurate summary of what people are seeing?

  • With Legacy Build System
    • With Cordova CLI (-UseModernBuildSystem=0)
      • Automatic Signing: Works
      • Manual Signing: Works
    • With Xcode (Workspace Settings -> Legacy Build System)
      • Automatic Signing: Works
      • Manual Signing: Works
  • With Modern/New Build System
    • With Cordova CLI
      • Automatic Signing: Fails?
      • Manual Signing: Maybe fails?
    • With Xcode
      • Automatic Signing: Fails
      • Manual Signing: Works?

I need to understand what works and what's broken before I can start investigating how to fix it, and everyone's comments seem to be saying different things.

@Stefano1964
Copy link

In Xcode

With Modern/New Build System

  • With Cordova CLI

    • Automatic Signing: Fails?
    • Manual Signing: Maybe fails?
  • With Xcode

    • Automatic Signing: Not tried
    • Manual Signing: Works

@Stefano1964
Copy link

I suspect this has to do with automatic signing in all case where it fails. It's not a new issue with Xcode...

@rossholdway
Copy link

Could be related? phonegap/phonegap-plugin-push#2518

@dpogue
Copy link
Member

dpogue commented Sep 19, 2018

Could be related? phonegap/phonegap-plugin-push#2518

I'm pretty sure that's unrelated. The embedded.mobileprovision is added (in this case) during the export step.

@newuser44
Copy link

I can't tell where my problem is at. I build the code using the command line. That seems to work. I open the project in Xcode and try to push to the phone. It fails building for some signing reason.
All I see is
Command /usr/bin/codesign failed with exit code 1

I'm not really sure what to even debug.
I did setup in Xcode to use the new build process.
I don't know if this is related or something else is wrong.

@dpogue
Copy link
Member

dpogue commented Sep 19, 2018

I think we've figured out the circumstances that cause this bug, and I've updated the Xcode 10 workaround announcement to avoid it.

In order to build Cordova apps on the command-line with Xcode 10, you need to set the -UseModernBuildSystem=0 flag. However, this flag only applies for that build.

If you open the resulting project in Xcode, it will by default try to use the new build system. You must update the workspace settings in the Xcode IDE and set the Build System to Legacy before making any builds through the Xcode IDE.
See this comment from @kitolog with helpful screenshots about how to do that.

As mentioned, I've updated #407 to include workaround instructions for anyone using the Xcode IDE, and I'm going to close this issue to try to keep all the information in one easily visible place. Thanks for your reports and error logs and patience everyone!

@dpogue dpogue closed this as completed Sep 19, 2018
@emirbosques
Copy link

Huh
I did it, so, for Ionic developers (and plain Cordova too) to solve problems with AppStore and Fabric

  1. To build in console
    ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
  2. To run in console
    ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
  3. To build archive using Xcode:
  • setup provisioning profile, certificates, etc. That's no matter using automatic or manual signing, do it habitual way as previously
  • In the Xcode, open Workspace Settings -> Build System -> and select Legacy Build System

Using Legacy Build System you will be able to build archive with normal mobileprovision and Info.plist files

2018-09-19 9 08 46 2018-09-19 9 09 03

Excellent!! Work for me!
Thanks! @kitolog

@ajayprakashshukla
Copy link

Using Legacy Build System you will be able to build archive with normal mobileprovision and Info.plist files

@collindutter
Copy link

collindutter commented Sep 26, 2018

@pliablepixels I'm stuck at the error that you were having in the morning. Any clue how you got past it?

Also, running ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0" fails immediately with this error: Unknown option: '--buildFlag'. Changing it to
ionic cordova run ios --buildFlag="-UseModernBuildSystem=0" seems to get me past that step, but I end up getting the same error as @pliablepixels

(node:6214) UnhandledPromiseRejectionWarning: Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,hemp-qr-scanner.xcarchive,-exportOptionsPlist,/Users/collindutter/Documents/scanner/platforms/ios/exportOptions.plist,-exportPath,/Users/collindutter/Documents/scanner/platforms/ios/build/device

@pliablepixels
Copy link

I'm not sure you are facing the same error as I did - in your case it seems --buildFlag is not recognized. I use cordova 8, cordova-ios 4.5.5

I shiver when I am asked to relive nightmares. Now that this is solved, I'm battling with WKWebView and self signed certs and the fact that Android builds have issues (when WKWebView is an iOS thing). Jokes apart - back to your question:

Here is what I do now:

  1. To build from CLI, I use
    ionic cordova build ios --release --buildConfig="./build-auto.json"
    (my build-auto.json)

  2. When I build using Xcode, I make sure "Legacy build system" is on as per the posts above.

Hope this helps.

@collindutter
Copy link

Well I truly don't know what I did, but after enough head banging, it works now? I think my ng-toolkit might've been out of date. For anyone in my exact scenario, here's my info and what I'm running to get it working.


Ionic:

   ionic (Ionic CLI)          : 4.1.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.11
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.1.4, (and 6 other plugins)

System:

   ios-deploy : 2.0.0
   NodeJS     : v10.11.0 (/usr/local/Cellar/node/10.11.0/bin/node)
   npm        : 6.4.1
   OS         : macOS
   Xcode      : Xcode 10.0 Build version 10A255

ionic cordova run ios --verbose -- -- --buildFlag="-UseModernBuildSystem=0"
(notice the two --)

Also, thanks @pliablepixels, good luck with your current issues.

@joelsonrocha
Copy link

Hi,

Access https://developer.apple.com/account

1 - Certificates, IDs & Profiles

2 - Provisioning Profiles

3 - Distribution

4 - Add Button

5 - Distribution -> App Store -> Continue

6 - Choose Apple Id -> Continue

7 - Select certificates -> Continue

8 - Set Profile Name -> Continue

9 - Download

10 - In Xcode -> Product -> Archive, In Re-sign "App Name" make option Manually manage signing -> choose the Distribution certificate and import your provisioning profile downloaded on step 9.

Sorry for my English, I'm from Brazil

@csotomon
Copy link

csotomon commented Oct 3, 2018

@joelsonrocha 's solution works for me

@godexsoft
Copy link

It can be made to work with all the hacks above. The real question is why is there debug and release sections in the json.build but only either one makes it to BOTH debug/release sections in the xcode project depending on the --debug/--release switch in cordova CLI. it does not make too much sense. A much better way would be to populate xcode project with both debug and release profiles and then just compile/build the correct version depending on the cli switch.

Is there anything i'm missing? maybe i did not understand how to use it correctly?

@janpio
Copy link
Member

janpio commented Jan 28, 2019

@godexsoft As I wrote somewhere else already: Please create a new issue about this instead of hijacking this unrelated, and closed one. Then we can take a look at what you describe. Thanks!

@dpogue dpogue added this to the 5.0.0 milestone Feb 6, 2019
sergaks referenced this issue in quasarframework/quasar Feb 26, 2019
@brentverhenne
Copy link

I have the same problem where automatic signing + new build system does not include the embedded.provisionprofile.

With the legacy build it works but then i have a few plugins that refuse to work. They do work when i build using the new build system but then it fails when trying to upload to apple.

Any solutions? How do i force xcode to create the embedded.provisionprofile using the new build system and automatic signing.

@dpogue
Copy link
Member

dpogue commented Feb 27, 2019

@clusterr023 This should be fixed in cordova-ios@5.0.0

@markterrill
Copy link

markterrill commented Jun 10, 2019

Hi,
On top of setting to legacy system, an important thing that helped me with notifications: Edit your Xcode scheme to use Release as its deployment type.

Product > Scheme > Edit scheme > Run (on the left panel) > Info tab > 'Build Configuration' set to 'Release'. Close and then play/run again to your phone.

@HarelM
Copy link

HarelM commented Dec 28, 2019

I might be missing out something very simple but reading the docs and this thread and trying out things did not work for me.
What I would like to do is create an ipa purely from command line without opening xcode at all and without macos popups.
I want to create an app using appveyor build system which now support macos image.
I couldn't understand from the docs and from the thread here how I can achieve this.
If anyone has a working example or some details on how to do it, it would help a lot.
I can open a different issue for this if needed.
I have a developer account. I'm able to manually publish packages but I don't understand how to make the build system create a package I can later upload to app store connect/manually sign it or what not. Any help/link/instructions would be helpful.

@breautek
Copy link
Contributor

@HarelM This issue is for distributing an app using Xcode.

I'm not familiar with appveyor but Apple essentially gives you two ways to distribute to iTunes Connect/App Store.

  1. Via Xcode GUI directly

  2. Use XCode to build a signed IPA file, then use Apple's Transporter app to upload the IPA file.

If you have anymore questions I encourage you to join slack and ask support style questions there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests