Ionic not building for ios, linker command failed, error 65

Hi,

I am not exactly sure what happend, but I am unable to build for ios.
The error i get when running ionic cordova build ios is

[21:03:49]  lint finished in 2.15 s
✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build ios (exit code 1):
......
ld: 212 duplicate symbols for architecture arm64
        clang: error: linker command failed with exit code 1 (use -v to see invocation)

and

 Error: Error code 65 for command: xcodebuild with args: -xcconfig,

I already did a
ionic cordova platform rm ios
ionic cordova platform add ios
but the error remains the same.

If I open the .xcworkspace and try to build it, I get a “Apple Mach-O Linker (ld) Error”.

My system

global packages:

    @ionic/cli-utils : 1.1.2
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.1.2

local packages:

    @ionic/app-scripts              : 1.3.6
    @ionic/cli-plugin-cordova       : 1.1.2
    @ionic/cli-plugin-ionic-angular : 1.1.2
    Ionic Framework                 : ionic-angular 3.1.1

System:

    Node       : v7.7.3
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002
    ios-deploy : 1.9.1
    ios-sim    : 5.0.13

Any ideas?

I just tested building the App with the ionic package build ios command and in the web dashboard I see the same error:

ld: 212 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/package/Library/Developer/Xcode/DerivedData/MyApp-gexmgxqebrbkezgnqbkqzjfobrsb/Build/Intermediates/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/MyApp normal arm64
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/package/workspace/apps-312bdc3f-2/cordova/platforms/ios/cordova/build-debug.xcconfig,-workspace,MyApp.xcworkspace,-scheme,MyApp,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,MyApp.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/package/workspace/apps-312bdc3f-2/cordova/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/package/workspace/apps-312bdc3f-2/cordova/platforms/ios/build/sharedpch

So it seems there must be something wrong with the project, not the build environment?
Building for Android works fine though, even created a release APK for the store.

No one here to help?

Finally found a solution:

ionic cordova platform update ios

solves the problem locally, but on app.ionic.io I get the same error when building.

2 Likes

Jesus fucking christ i’m getting sick of wasting 5 hours on these these bizarre ionic errors.

Thank you sir.

6 Likes

I’m having the same error when using ionic’s package service. Any hints?

1 Like

I’m having the same issue using phonegap-plugin-push…

I thought I had solved this by creating a new project but it just resurfaced
possible solution:

1 Like

do you have an apple developer account? It seems that any app that includes push notifications (push, onesignal) adds

<key>aps-environment</key>

To the iOS platform entitlements, which seems to be a brick wall if you’re not accredited with an apple push notification service cert