apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

Unable to distribute with Xcode 10 #412

Closed neofuture closed 5 years ago

neofuture commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

Right now we only have workaround for builds with the CLI published over at https://github.com/apache/cordova-ios/issues/407. You might need some instructions on how to get a Xcode only project to work. Someone will have to look into this.

neofuture commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

sufian4199 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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

dpogue commented 5 years ago

@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
Automatic Signing | Export with
Manual Signing | |-------------------------------|----------------------------------|-------------------------------| | Xcode IDE | | | | Cordova/Ionic CLI | | | | *Bonus Info:*
Fastlane CLI | | | ```
rossholdway commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

"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 commented 5 years ago

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:

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
phillipplum commented 5 years ago

Thank you @kitolog. This works for us!

neofuture commented 5 years ago

Thanks @kitolog Legacy appears to be working for me, im just waiting for the binary to process

Stefano1964 commented 5 years ago

I always manually sign my apps, i never use command line, so i use Xcode, for me it's working also with the new build system in Xcode, i tried with an Ad Hoc export.

neofuture commented 5 years ago

@Stefano1964 i can use the new build system in Xcode the issue is when trying to distribute, ad hoc will work but app store connect wont accept the binary because of a missing provisioning profile.

Stefano1964 commented 5 years ago

Mhh, did you manually import the ditribution certificate, in the general tab, in "signing release"?

rossholdway commented 5 years ago

@kitolog Thanks for the workaround. Works for me 👍 (using the legacy build system now allows me to archive via Xcode 10 and the app validates successfully).

@dpogue I think the issue here is that for some reason, the new build system doesn't include the embedded.mobileprovision within the app bundle for Cordova generated Xcode projects if you use automatic signing. I have a very basic native swift project that works fine with auto signing and the new build system.

Example from running cordova create MyApp, cordova platform add ios screen shot 2018-09-19 at 11 04 18

peterpeterparker commented 5 years ago

I join @Stefano1964 on that one, I do the same, I process the signing of the app in Xcode and therefore it seems I don't face problems with my existing app/platform and Xcode 10

First I have added an alert("test"); to my very first page, in order to be sure, when I would test, that I would see something different ;)

Then I opened Xcode 10 and selected "Generic iOS Device" (not sure if it's relevant). Then Xcode began to index files. Under warnings I just found one warning asking me some modifications in the project regarding the signing, sorry went to fast, I'm dumb, any how I say yes and I let Xcode doing its modifications

Then I have build my app like I always do

 ionic cordova build ios --prod

Went back to Xcode 10, selected "iPhone 8" and launched ("Play button") my app which was launched without problems and my above alert was throw (once the app loaded of course)

That would also explain why I didn't noticed problems when I tested Xcode 10 beta back in June this year

Also I just tested "Xcode > Product > Archive" it went fine too, but I didn't tried to go further

Stefano1964 commented 5 years ago

To summarize, i think that actually the bug is related to the Cordova CLI. For some reasons (path related?) the build with CLI fails with new build system not including the provisioning profile. If you use Xcode to build the only thing to do is to manually assign the provisioning profile.

dpogue commented 5 years ago

For some reasons (path related?) the build with CLI fails with new build system not including the provisioning profile.

The new build system is not supported, so it's expected the fail. That's a separate issue from the signing problem that people are seeing here.

Stefano1964 commented 5 years ago

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

Stefano1964 commented 5 years ago

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 commented 5 years ago

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?

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 commented 5 years ago

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 commented 5 years ago

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

rossholdway commented 5 years ago

Could be related? https://github.com/phonegap/phonegap-plugin-push/issues/2518

dpogue commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 https://github.com/apache/cordova-ios/issues/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!

emirbosques commented 5 years ago

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 commented 5 years ago

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

collindutter commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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