Getting error on ios build

:heavy_multiplication_x: Running command - failed!
[ERROR] An error occurred while running cordova build ios (exit code 1):

    (truncated) ... ms/ios/build/device 
    -L/Volumes/Untitled/vaiotifronttend/Vioti/platforms/ios/VAIOTI/Plugins/cordova-plugin-extension 
    -F/Volumes/Untitled/vaiotifronttend/Vioti/platforms/ios/build/device -FVAIOTI/Plugins/com.googlemaps.ios 
    -FVAIOTI/Plugins/cordova-plugin-admobpro -FVAIOTI/Plugins/cordova-plugin-facebook4 
    -FVAIOTI/Plugins/cordova-plugin-googleplus -filelist 
    /Users/abhimanyukumar/Library/Developer/Xcode/DerivedData/VAIOTI-gdfjceerbybmfpctsiyetdgxwcpr/Build/Intermediates.noindex/ArchiveIntermediates/VAIOTI/IntermediateBuildFilesPath/VAIOTI.build/Debug-iphoneos/VAIOTI.build/Objects-normal/arm64/VAIOTI.LinkFileList 
    -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=11.0 -dead_strip -Xlinker 
    -object_path_lto -Xlinker 
    /Users/abhimanyukumar/Library/Developer/Xcode/DerivedData/VAIOTI-gdfjceerbybmfpctsiyetdgxwcpr/Build/Intermediates.noindex/ArchiveIntermediates/VAIOTI/IntermediateBuildFilesPath/VAIOTI.build/Debug-iphoneos/VAIOTI.build/Objects-normal/arm64/VAIOTI_lto.o 
    -Xlinker -no_deduplicate -Xlinker -final_output -Xlinker /Applications/VAIOTI.app/VAIOTI -fobjc-arc 
    -fobjc-link-runtime 
    -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker 
    -add_ast_path -Xlinker 
    /Users/abhimanyukumar/Library/Developer/Xcode/DerivedData/VAIOTI-gdfjceerbybmfpctsiyetdgxwcpr/Build/Intermediates.noindex/ArchiveIntermediates/VAIOTI/IntermediateBuildFilesPath/VAIOTI.build/Debug-iphoneos/VAIOTI.build/Objects-normal/arm64/VAIOTI.swiftmodule 
    -ObjC /Volumes/Untitled/vaiotifronttend/Vioti/platforms/ios/build/device/libCordova.a -framework Accelerate 
    -framework CoreData -framework CoreLocation -framework CoreTelephony -framework CoreText -framework GLKit 
    -framework ImageIO -lc++ -lz -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework 
    UIKit -framework GoogleMapsBase -framework GoogleMaps -framework GoogleMapsCore -lCordovaGenericAd -framework 
    CFNetwork -framework GoogleMobileAds -framework AdSupport -framework AudioToolbox -framework AVFoundation 
    -framework CoreBluetooth -framework CoreMedia -framework CoreMotion -framework CoreVideo -framework EventKit 
    -framework EventKitUI -framework Foundation -framework MediaPlayer -framework MessageUI -framework 
    SafariServices -framework StoreKit -framework Bolts -framework FBSDKCoreKit -framework FBSDKLoginKit -framework 
    FBSDKShareKit -framework GoogleAppUtilities -framework GoogleAuthUtilities -framework GoogleNetworkingUtilities 
    -framework GoogleSignIn -framework GoogleSymbolUtilities -framework GoogleUtilities -weak_framework AddressBook 
    -weak_framework Security -weak-lz -weak-lsqlite3 -weak_framework WebKit -framework Photos -framework Contacts 
    -framework UserNotifications -liconv -framework CoreImage -framework MapKit -Xlinker -dependency_info -Xlinker 
    /Users/abhimanyukumar/Library/Developer/Xcode/DerivedData/VAIOTI-gdfjceerbybmfpctsiyetdgxwcpr/Build/Intermediates.noindex/ArchiveIntermediates/VAIOTI/IntermediateBuildFilesPath/VAIOTI.build/Debug-iphoneos/VAIOTI.build/Objects-normal/arm64/VAIOTI_dependency_info.dat 
    -o 
    /Users/abhimanyukumar/Library/Developer/Xcode/DerivedData/VAIOTI-gdfjceerbybmfpctsiyetdgxwcpr/Build/Intermediates.noindex/ArchiveIntermediates/VAIOTI/InstallationBuildProductsLocation/Applications/VAIOTI.app/VAIOTI
    duplicate symbol _OBJC_CLASS_$_CDVLogger in:
         
    /Users/abhimanyukumar/Library/Developer/Xcode/DerivedData/VAIOTI-gdfjceerbybmfpctsiyetdgxwcpr/Build/Intermediates.noindex/ArchiveIntermediates/VAIOTI/IntermediateBuildFilesPath/VAIOTI.build/Debug-iphoneos/VAIOTI.build/Objects-normal/arm64/CDVLogger.o
         /Volumes/Untitled/vaiotifronttend/Vioti/platforms/ios/build/device/libCordova.a(CDVLogger.o)
    duplicate symbol _OBJC_METACLASS_$_CDVLogger in:
         
    /Users/abhimanyukumar/Library/Developer/Xcode/DerivedData/VAIOTI-gdfjceerbybmfpctsiyetdgxwcpr/Build/Intermediates.noindex/ArchiveIntermediates/VAIOTI/IntermediateBuildFilesPath/VAIOTI.build/Debug-iphoneos/VAIOTI.build/Objects-normal/arm64/CDVLogger.o
         /Volumes/Untitled/vaiotifronttend/Vioti/platforms/ios/build/device/libCordova.a(CDVLogger.o)
    ld: 2 duplicate symbols for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    ** ARCHIVE FAILED **
    
    
    The following build commands failed:
            Ld 
    /Users/abhimanyukumar/Library/Developer/Xcode/DerivedData/VAIOTI-gdfjceerbybmfpctsiyetdgxwcpr/Build/Intermediates.noindex/ArchiveIntermediates/VAIOTI/InstallationBuildProductsLocation/Applications/VAIOTI.app/VAIOTI 
    normal arm64
    (1 failure)
    Error: Error code 65 for command: xcodebuild with args: 
    -xcconfig,/Volumes/Untitled/vaiotifronttend/Vioti/platforms/ios/cordova/build-debug.xcconfig,-workspace,VAIOTI.xcworkspace,-scheme,VAIOTI,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,VAIOTI.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Volumes/Untitled/vaiotifronttend/Vioti/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Volumes/Untitled/vaiotifronttend/Vioti/platforms/ios/build/sharedpch

My ionic info

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.13.1
ionic (Ionic CLI) : 3.13.1

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 1.3.4
Cordova Platforms  : android 6.2.3 ios 4.5.2
Ionic Framework    : ionic-angular 2.0.0-rc.5-201701232249

System:

ios-deploy : 1.9.2 
Node       : v6.11.4
npm        : 3.10.10 
OS         : macOS High Sierra
Xcode      : Xcode 9.0.1 Build version 9A1004 

Misc:

backend : pro

I’ve seen that error when I didn’t configure Xcode signing correctly. I would double check your Xcode signature settings.

Also, you seem to be on an old version of app-scripts (3.0 is the newest), and I would move to a newer version of ionic-angular (it’d be best to avoid an rc version).

You just upgraded the cordova-ios platform, correct?
Do you still have the console plugin installed?
Uninstall it.

Cordova integrated the Console plugin into cordova-ios in 4.5.x. Unfortunately they didn’t really find a good way to tell the user that they have to uninstall the plugin or their builds will fail.

1 Like

I have the same issue since I updated cordova-ios (in order to be able to automatically create the 1024x marketing icon for iOS 11).

I have tried all combinations of ionic-cli 3.13.2 ionic-angular 3.6 and 3.7.1 and app scripts version and typescript version and angular-apollo version, but these updates cause other problems.

Any hints to solve the iOS build problem, so that I can start investigating the other ones?

cli packages: (/Users/chris/Development/viq-app/node_modules)

@ionic/cli-utils  : 1.13.0
ionic (Ionic CLI) : 3.13.0

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.1.2 ios 4.5.2
Ionic Framework    : ionic-angular 3.7.1

System:

Android SDK Tools : 25.2.5
ios-deploy        : 1.9.0 
ios-sim           : 5.0.3 
Node              : v6.9.5
npm               : 5.3.0 
OS                : macOS High Sierra
Xcode             : Xcode 9.0 Build version 9A235 

Misc:

backend : legacy

Did you read my previous post?

Update this.

I did update to the newest version, but then i suddenly got typescript errors when trying to do .map on a Apollo Angular subsription. So i went back to old versions of app script. I’ll try again tomorrow to further narrow it down.

edit: yes i did remove the console plugin

And you still have the exact same error message as the original posteR?

I have removed the console plugin and have updated app scripts. Still the original error message.

cli packages: (/Users/chris/Development/viq-app/node_modules)

@ionic/cli-utils  : 1.13.0
ionic (Ionic CLI) : 3.13.0

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 3.0.1
Cordova Platforms  : android 6.1.2 ios 4.5.2
Ionic Framework    : ionic-angular 3.7.1

System:

Android SDK Tools : 25.2.5
ios-deploy        : 1.9.0 
ios-sim           : 5.0.3 
Node              : v6.9.5
npm               : 5.3.0 
OS                : macOS High Sierra
Xcode             : Xcode 9.0 Build version 9A235 

Misc:

backend : legacy

You should post your (complete) error message. If ionic cordova ... doesn’t output it, run the command without ionic and post its output here.


Ld /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ\ Sales/IntermediateBuildFilesPath/IQ\ Sales.build/Debug-iphoneos/IQ\ Sales.build/Objects-normal/arm64/IQ\ Sales normal arm64
    cd /Users/chris/Development/viq-app/platforms/ios
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/chris/.rbenv/shims:/Users/chris/.yarn/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Developer/android-sdk-macosx/bin:/Developer/android-sdk-macosx/platform-tools:/Developer/android-sdk-macosx/tools:/Applications/MAMP/Library/bin:/Developer/apache-ant-1.9.4/bin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk -L/Users/chris/Development/viq-app/platforms/ios/build/device -F/Users/chris/Development/viq-app/platforms/ios/build/device -filelist /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ\ Sales/IntermediateBuildFilesPath/IQ\ Sales.build/Debug-iphoneos/IQ\ Sales.build/Objects-normal/arm64/IQ\ Sales.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ\ Sales/IntermediateBuildFilesPath/IQ\ Sales.build/Debug-iphoneos/IQ\ Sales.build/Objects-normal/arm64/IQ\ Sales_lto.o -Xlinker -no_deduplicate -Xlinker -final_output -Xlinker /Applications/IQ\ Sales.app/IQ\ Sales -fobjc-arc -fobjc-link-runtime -ObjC /Users/chris/Development/viq-app/platforms/ios/build/device/libCordova.a -weak_framework ImageIO -framework CoreLocation -framework AVFoundation -framework MessageUI -weak_framework WebKit -lz -liconv -framework CoreVideo -framework QuartzCore -framework CoreImage -framework AudioToolbox -Xlinker -dependency_info -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ\ Sales/IntermediateBuildFilesPath/IQ\ Sales.build/Debug-iphoneos/IQ\ Sales.build/Objects-normal/arm64/IQ\ Sales_dependency_info.dat -o /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ\ Sales/IntermediateBuildFilesPath/IQ\ Sales.build/Debug-iphoneos/IQ\ Sales.build/Objects-normal/arm64/IQ\ Sales
duplicate symbol _OBJC_CLASS_$_CDVClipboard in:
    /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ Sales/IntermediateBuildFilesPath/IQ Sales.build/Debug-iphoneos/IQ Sales.build/Objects-normal/arm64/CDVClipboard-BCAF013124B1BB6B.o
    /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ Sales/IntermediateBuildFilesPath/IQ Sales.build/Debug-iphoneos/IQ Sales.build/Objects-normal/arm64/CDVClipboard-1B5585BC42574A64.o
duplicate symbol _OBJC_METACLASS_$_CDVClipboard in:
    /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ Sales/IntermediateBuildFilesPath/IQ Sales.build/Debug-iphoneos/IQ Sales.build/Objects-normal/arm64/CDVClipboard-BCAF013124B1BB6B.o
    /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ Sales/IntermediateBuildFilesPath/IQ Sales.build/Debug-iphoneos/IQ Sales.build/Objects-normal/arm64/CDVClipboard-1B5585BC42574A64.o
ld: 2 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** ARCHIVE FAILED **


The following build commands failed:
	Ld /Users/chris/Library/Developer/Xcode/DerivedData/IQ_Sales-cvksovrjucmfkpgyhwgdcorkxqcn/Build/Intermediates.noindex/ArchiveIntermediates/IQ\ Sales/IntermediateBuildFilesPath/IQ\ Sales.build/Debug-iphoneos/IQ\ Sales.build/Objects-normal/arm64/IQ\ Sales normal arm64
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/chris/Development/viq-app/platforms/ios/cordova/build-debug.xcconfig,-workspace,IQ Sales.xcworkspace,-scheme,IQ Sales,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,IQ Sales.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/chris/Development/viq-app/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/chris/Development/viq-app/platforms/ios/build/sharedpch
MacBook-Air-2:viq-app chris$

Tried https://cordova.apache.org/docs/en/latest/reference/cordova-cli/#cordova-clean-command?
Can you build a new project started with ionic start?

ionic clean doesn’t help, and I can NOT compile a new project (ionic start blank, cordova build ios)

But: I can build other projects

I tried to downgrade to “cordova-ios”: “4.4.0” but I still can’t compile this project. I followed these steps:

yarn add cordova-ios@4.4.0
ionic platform rm ios
cordova clean
ionic cordova platform add ios
ionic cordova resources
rm -rf node_modules
yarn install
ionic cordova build ios
xcode: remove and add “automatically manage signing” and select profile
ionic cordova build ios

Error is now similar to above: “ld: 2 duplicate symbols for architecture armv7”

This is my ionic info:

cli packages: (/Users/chris/Development/viq-app/node_modules)

@ionic/cli-utils  : 1.13.0
ionic (Ionic CLI) : 3.13.0

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 3.0.1
Cordova Platforms  : android 6.1.2 ios 4.4.0
Ionic Framework    : ionic-angular 3.7.1

System:

Android SDK Tools : 25.2.5
ios-deploy        : 1.9.2 
ios-sim           : 5.0.3 
Node              : v6.9.5
npm               : 5.3.0 
OS                : macOS High Sierra
Xcode             : Xcode 9.0 Build version 9A235 

Misc:

backend : legacy

Saying all this, this project compiled well, before I updated cordova ios. (Not with --prod though, but I guess that was a different issue).

cordova plugin ls
:heavy_check_mark: Running command - done!
com.verso.cordova.clipboard 0.1.0 "Clipboard"
cordova-clipboard 1.0.0 "Clipboard"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-email 1.2.6 "EmailComposer"
cordova-plugin-ionic-webview 1.1.8 "Ionic’s WKWebView Engine"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.4-dev "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
mx.ferreyra.callnumber 0.0.2 "Cordova Call Number Plugin"
phonegap-plugin-barcodescanner 6.0.6 “BarcodeScanner”

call number plugin causes issues between call-number and mx.ferreyra.callnumber, but ok I can circumvent these.

I have another project which compiles just fine:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.13.1
ionic (Ionic CLI) : 3.13.2

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : ios 4.4.0
Ionic Framework    : ionic-angular 3.7.0

System:

Android SDK Tools : 25.2.5
ios-deploy        : 1.9.2 
ios-sim           : 6.1.2 
Node              : v6.9.5
npm               : 5.3.0 
OS                : macOS High Sierra
Xcode             : Xcode 9.0 Build version 9A235 

Misc:

backend : legacy

EDIT: Trying now to update from XCode 9.0 to 9.0.1

Do these clash maybe?

Deinstalled both. No change

Are they also removed from the native project?
It doesn’t make sense that you get error messages for code that is not present any more.

Looks like they didn’t get removed correctly and indeed it seems as if they where the main reason for the issue. I have removed them and removed all platforms and re-installed everything (except the clipboard plugins) and upgraded all versions to the latest (except rxjs which doesnt work with apollo-angular).

Seems to work so far.

Thanks for the help and the good hint!!

By the way: Any recommendation for a clipboard plugin? The one mentioned in ionic native docs doesn’t install.

1 Like

Create a new topic with the “doesn’t install” error message etc, should be fixable.