Error run ionic cordova build ios --prod on mac

#1

Hey,
I need help when I launch this command ionic cordova build ios --prod.

I get this error:

cordova build ios --release
Discovered plugin “cordova-plugin-globalization” in config.xml. Adding it to the project
Plugin “org.apache.cordova.globalization” already installed on ios.
Discovered plugin “call-number” in config.xml. Adding it to the project
Plugin “mx.ferreyra.callnumber” already installed on ios.
Building project: /Users/…/…t/cityneed/platforms/ios/CityNeed.xcworkspace
Configuration: Release
Platform: device
User defaults from command line:
IDEArchivePathOverride = /Users/…/…/cityneed/platforms/ios/CityNeed.xcarchive

Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/…/…/cityneed/platforms/ios/build/device
SHARED_PRECOMPS_DIR = /Users/…/…/cityneed/platforms/ios/build/sharedpch

Build settings from configuration file ‘/Users/…/…/cityneed/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 HEADER_SEARCH_PATHS = "(TARGET_BUILD_DIR)/usr/local/lib/include" “(OBJROOT)/UninstalledProducts/include" "(OBJROOT)/UninstalledProducts/(PLATFORM_NAME)/include" "(BUILT_PRODUCTS_DIR)”
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = (PROJECT_DIR)/(PROJECT_NAME)/Bridging-Header.h

2019-01-04 16:06:56.210 xcodebuild[31795:872835] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
2019-01-04 16:06:56.210 xcodebuild[31795:872835] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
2019-01-04 16:06:56.211 xcodebuild[31795:872835] iPhoneSupport: :iphone:<DVTiOSDevice (0x7fe470b5b0e0), iPhone, iPhone,12.1.2 (16C101), 074986ac43ec97cad434d78d32efc6afa92d9fa3> unable to mount DeveloperDiskImage (Error Domain=com.apple.dtdevicekit Code=601 “Could not find platform” UserInfo={NSLocalizedDescription=Could not find platform})
2019-01-04 16:06:56.231 xcodebuild[31795:872827] [MT] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
2019-01-04 16:06:56.249 xcodebuild[31795:872827] [MT] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
2019-01-04 16:06:56.268 xcodebuild[31795:872827] [MT] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
2019-01-04 16:06:56.285 xcodebuild[31795:872827] [MT] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
2019-01-04 16:06:56.333 xcodebuild[31795:872827] [MT] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
2019-01-04 16:06:56.351 xcodebuild[31795:872827] [MT] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
2019-01-04 16:06:56.368 xcodebuild[31795:872827] [MT] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
2019-01-04 16:06:56.386 xcodebuild[31795:872827] [MT] DTDeviceKit: deviceType from d2d1aa65acd26fe3c39a1b4e21d062321b8fa4f9 was NULL
error: archive not found at path ‘/Users/…/…/cityneed/platforms/ios/CityNeed.xcarchive’
** EXPORT FAILED **

CordovaError: Promise rejected with non-error: ‘Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,CityNeed.xcarchive,-exportOptionsPlist,/Users/…/…/cityneed/platforms/ios/exportOptions.plist,-exportPath,/Users/…/…/cityneed/platforms/ios/build/device’
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
[ERROR] An error occurred while running subprocess cordova.

    cordova build ios --release exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

MacBook-Pro:cityneed … $ cordova build ios --prod
Discovered plugin “cordova-plugin-globalization” in config.xml. Adding it to the project
Plugin “org.apache.cordova.globalization” already installed on ios.
Discovered plugin “call-number” in config.xml. Adding it to the project
Plugin “mx.ferreyra.callnumber” already installed on ios.
Building project: /Users/…/…/cityneed/platforms/ios/CityNeed.xcworkspace
Configuration: Debug
Platform: device
User defaults from command line:
IDEArchivePathOverride = /Users/…/…/cityneed/platforms/ios/CityNeed.xcarchive

Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/…/…/cityneed/platforms/ios/build/device
SHARED_PRECOMPS_DIR = /Users/…/…/cityneed/platforms/ios/build/sharedpch

Build settings from configuration file ‘/Users/…/…/platforms/ios/cordova/build-debug.xcconfig’:
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_ENTITLEMENTS = (PROJECT_DIR)/(PROJECT_NAME)/Entitlements-(CONFIGURATION).plist CODE_SIGN_IDENTITY = iPhone Developer ENABLE_BITCODE = NO GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 HEADER_SEARCH_PATHS = "(TARGET_BUILD_DIR)/usr/local/lib/include" “(OBJROOT)/UninstalledProducts/include" "(OBJROOT)/UninstalledProducts/(PLATFORM_NAME)/include" "(BUILT_PRODUCTS_DIR)”
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = (PROJECT_DIR)/(PROJECT_NAME)/Bridging-Header.h

2019-01-04 16:13:57.358 xcodebuild[32032:881057] DTDeviceKit: deviceType from 074986ac43ec97cad434d78d32efc6afa92d9fa3 was NULL
error: archive not found at path ‘/Users/…/…/platforms/ios/CityNeed.xcarchive’
** EXPORT FAILED **

CordovaError: Promise rejected with non-error: ‘Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,CityNeed.xcarchive,-exportOptionsPlist,/Users/…/…/platforms/ios/exportOptions.plist,-exportPath,/Users/…/…/platforms/ios/build/device’
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at process._tickCallback (internal/process/next_tick.js:68:7)

It is my ionic info:

Ionic:

ionic (Ionic CLI) : 4.6.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.8

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic 2.0.4, cordova-plugin-ionic-webview 1.2.1, (and 23 other plugins)

System:

ios-deploy : 1.9.4
ios-sim : 7.0.0
NodeJS : v10.15.0 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61

#2

I also have this issue. Was this resolved?

#3

No, the problem is still not solved. I have not had an answer yet. But I continue to search …
if anyone can help us

#4

Same problem here. :confused:

#5

Me too having the same error.

Anybody with the solution. Lots of people need it…

#6

Anybody found the solution yet?

#7

Hey

I am fighting iOS at the moment.

Since you are using Cordova Platforms : ios 4.5.5. For your issue please see https://github.com/apache/cordova-ios/issues/407

See XCode part, where you set legacy build mode on ios project.

I have bit different issue, so not working for me.

#8
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

will work. In Xcode you can select to use legacy build system and it will build.