# Ionic Error: Apple Mach-O Linker Error

**URL:** <https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201>\
**Category:** ionic-v3\
**Created:** [September 12, 2017, 3:33pm UTC](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201 "2017-09-12T15:33:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NLKok](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nlkok/32/101380_2.png) [@NLKok](https://forum.ionicframework.com/u/NLKok)\
**Post date:** [September 12, 2017, 3:33pm UTC](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201/1 "2017-09-12T15:33:33Z")

</div>

I have the same problem as [Ionic Error: Apple Mach-O Linker Error - Have tried so much already](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error-have-tried-so-much-already/105007).

Also tried to remove and re-adding the iOS platform in our project. Even when I create a new blank Ionic project (with the same app id) I get the same error. This is my ionic info log:

```auto
cli packages: (/Users/niels/.config/yarn/global/node_modules)

    @ionic/cli-utils : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:

    Cordova CLI : 7.0.1 

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms : ios 4.5.0
    Ionic Framework : ionic-angular 3.6.1

System:

    Node : v6.11.2
    npm : 2.15.12 
    OS : macOS Sierra
    Xcode : Xcode 8.3.3 Build version 8E3004b

```

Any idea?

---

<div class="post-metadata">

**Author:** ![NLKok](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nlkok/32/101380_2.png) [@NLKok](https://forum.ionicframework.com/u/NLKok)\
**Post date:** [September 13, 2017, 7:12am UTC](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201/2 "2017-09-13T07:12:37Z")

</div>

```auto
[ERROR] An error occurred while running cordova build ios (exit code 1):

        
        (truncated) ... /Users/niels/Code/crappyapp/platforms/ios/build/emulator/include 
        -I/Users/niels/Code/crappyapp/platforms/ios/build/emulator/usr/local/lib/include 
        -I/Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/UninstalledProducts/include 
        -I/Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/UninstalledProducts/iphonesimulator/include 
        -I/Users/niels/Code/crappyapp/platforms/ios/build/emulator 
        -I/Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources/x86_64 
        -I/Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources 
        -F/Users/niels/Code/crappyapp/platforms/ios/build/emulator -include 
        /Users/niels/Code/crappyapp/platforms/ios/build/sharedpch/MyApp-Prefix-bsyppdqhhyomaoefawtzpjlhihyi/MyApp-Prefix.pch 
        -MMD -MT dependencies -MF 
        /Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/IonicKeyboard.d 
        --serialize-diagnostics 
        /Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/IonicKeyboard.dia 
        -c 
        /Users/niels/Code/crappyapp/platforms/ios/MyApp/Plugins/ionic-plugin-keyboard/IonicKeyboard.m 
        -o 
        /Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/IonicKeyboard.o
        
        Ld build/emulator/MyApp.app/MyApp normal x86_64
             cd /Users/niels/Code/crappyapp/platforms/ios
             export IPHONEOS_DEPLOYMENT_TARGET=10.0
             export 
        PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
             
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang 
        -arch x86_64 -isysroot 
        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk 
        -L/Users/niels/Code/crappyapp/platforms/ios/build/emulator 
        -F/Users/niels/Code/crappyapp/platforms/ios/build/emulator -filelist 
        /Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp.LinkFileList 
        -Xlinker -rpath -Xlinker @executable_path/Frameworks 
        -mios-simulator-version-min=10.0 -dead_strip -Xlinker -object_path_lto -Xlinker 
        /Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp_lto.o 
        -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc 
        -fobjc-link-runtime -ObjC -Xlinker -sectcreate -Xlinker __TEXT -Xlinker 
        __entitlements -Xlinker 
        /Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp.app.xcent 
        /Users/niels/Code/crappyapp/platforms/ios/build/emulator/libCordova.a -Xlinker 
        -dependency_info -Xlinker 
        /Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp_dependency_info.dat 
        -o /Users/niels/Code/crappyapp/platforms/ios/build/emulator/MyApp.app/MyApp
        duplicate symbol _OBJC_CLASS_$_CDVLogger in:
             
        /Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/CDVLogger.o
             
        /Users/niels/Code/crappyapp/platforms/ios/build/emulator/libCordova.a(CDVLogger.o)
        duplicate symbol _OBJC_METACLASS_$_CDVLogger in:
             
        /Users/niels/Library/Developer/Xcode/DerivedData/MyApp-gwyyhhzbodfcpqbjpzxwnzohsxgw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/CDVLogger.o
             
        /Users/niels/Code/crappyapp/platforms/ios/build/emulator/libCordova.a(CDVLogger.o)
        ld: 2 duplicate symbols for architecture x86_64
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        
        **BUILD FAILED**
        
        
        The following build commands failed:
        	Ld build/emulator/MyApp.app/MyApp normal x86_64
        (1 failure)
        Error: Error code 65 for command: xcodebuild with args: 
        -xcconfig,/Users/niels/Code/crappyapp/platforms/ios/cordova/build-debug.xcconfig,-workspace,MyApp.xcworkspace,-scheme,MyApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS 
        Simulator,name=iPhone 
        SE,build,CONFIGURATION_BUILD_DIR=/Users/niels/Code/crappyapp/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/niels/Code/crappyapp/platforms/ios/build/sharedpch
  

```

Is there anything I can do to see more logs?

And @robertlair, I just installed my new MacBook last week, so I doubt if that will fix my problem. I just installed Visual Studio Code, Xcode, Angular, Ionic and Cordova, that’s about it. But good to hear that you are back in business and thanks for your suggestion 😃

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [September 13, 2017, 8:15am UTC](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201/3 "2017-09-13T08:15:38Z")

</div>

Ahhh, I know what it is!

You are running `cordova-ios` 4.5.0 - did you remove the console plugin? If not, do so and try again.

---

<div class="post-metadata">

**Author:** ![NLKok](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nlkok/32/101380_2.png) [@NLKok](https://forum.ionicframework.com/u/NLKok)\
**Post date:** [September 13, 2017, 11:20am UTC](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201/4 "2017-09-13T11:20:14Z")

</div>

This is what I did:

```auto
> ionic cordova plugin remove cordova-plugin-console

cordova plugin remove cordova-plugin-console --save
✖ Running command - failed!
[ERROR] An error occurred while running cordova plugin remove cordova-plugin-console --save (exit code 1):

Error: Plugin "cordova-plugin-console" is not present in the project. See `cordova plugin list`.

```

Wierd, the cordova-plugin-console is present in the package.json and the config.xml, but ok. Lets try to add it first, so I did:

```auto
> ionic cordova plugin add cordova-plugin-console

cordova plugin add cordova-plugin-console --save
✔ Running command - done!
Adding cordova-plugin-console to package.json
Saved plugin info for "cordova-plugin-console" to config.xml

```

Then I tried to remove it:

```auto
> ionic cordova plugin remove cordova-plugin-console

cordova plugin remove cordova-plugin-console --save
✔ Running command - done!
Removing "cordova-plugin-console"
Removing plugin cordova-plugin-console from config.xml file...
Removing cordova-plugin-console from package.json

```

Ok, that worked, no build it.

```auto
> ionic cordova build ios

[INFO] Running app-scripts build: --platform ios --target cordova    
[12:57:50] build dev started ... 
[12:57:50] clean started ... 
[12:57:50] clean finished in 4 ms 
[12:57:50] copy started ... 
[12:57:50] transpile started ... 
[12:57:53] transpile finished in 2.49 s 
[12:57:53] preprocess started ... 
[12:57:53] deeplinks started ... 
[12:57:53] deeplinks finished in 120 ms 
[12:57:53] preprocess finished in 121 ms 
[12:57:53] webpack started ... 
[12:57:53] copy finished in 2.75 s 
[12:58:01] webpack finished in 8.09 s 
[12:58:01] sass started ... 
[12:58:02] sass finished in 794 ms 
[12:58:02] postprocess started ... 
[12:58:02] removed unused font files 
[12:58:02] postprocess finished in 5 ms 
[12:58:02] lint started ... 
[12:58:02] build dev finished in 11.54 s 
> ionic cordova prepare
> cordova prepare
⠴ Running command [12:58:56] lint finished in 54.45 s 
✔ Running command - done!
> cordova build ios
✔ Running command - done!
...........
**BUILD SUCCEEDED**

```

😃 That worked! 👍 Thanks for your help @Sujan12!

But now the plugin is also removed for Android, can that cause any problems for my Android app? Are you sure I don’t need the cordova-plugin-console plugin? And what is the difference with the iOS engine 4.4 and 4.5?

---

<div class="post-metadata">

**Author:** ![HinderiksR](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@HinderiksR](https://forum.ionicframework.com/u/HinderiksR)\
**Post date:** [September 13, 2017, 11:22am UTC](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201/5 "2017-09-13T11:22:18Z")

</div>

You should revert back to 4.4.0 and wait till they fix 4.5.0 using the following commands:

npm uninstall cordova-ios

npm install cordova-ios@4.4.0

ionic cordova platform add ios@4.4.0

ionic cordova build ios

---

<div class="post-metadata">

**Author:** ![NLKok](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nlkok/32/101380_2.png) [@NLKok](https://forum.ionicframework.com/u/NLKok)\
**Post date:** [September 13, 2017, 11:32am UTC](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201/6 "2017-09-13T11:32:21Z")

</div>

That works and sounds like the safest option for now.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [September 13, 2017, 12:18pm UTC](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201/7 "2017-09-13T12:18:47Z")

</div>

There will be no fix for `cordova-ios` as there is no bug. Cordova deliberately integrated the console plugin (and kinda decided in an “interesting” way for the upgrade path… but well, it is how it is)

See here: [Cordova-ios 4.5.0 was released!](https://forum.ionicframework.com/t/cordova-ios-4-5-0-was-released/105058) and the linked blog post in there.

But staying with `cordova-ios` 4.4.0 still is a valid choice for now.

> [@NLKok](#):
>
> Are you sure I don’t need the cordova-plugin-console plugin?

Not for iOS anyway.

> [@NLKok](#):
>
> And what is the difference with the iOS engine 4.4 and 4.5?

See the linked blog post above.

---

<div class="post-metadata">

**Author:** ![devsm](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@devsm](https://forum.ionicframework.com/u/devsm)\
**Post date:** [April 20, 2018, 1:18pm UTC](https://forum.ionicframework.com/t/ionic-error-apple-mach-o-linker-error/105201/8 "2018-04-20T13:18:28Z")

</div>

> [@NLKok](#):
>
> ionic cordova platform add ios@4.4.0

I’m stucked with the same problem…  
I removed the cordova-plugin-console =\> nothing  
I get back to cordova-ios 4.4.0 =\> nothing

I don’t know what to do…

cli packages: (/Users/simonesummo/Sviluppo/IONIC/glt-mobile/node\_modules)

```
@ionic/cli-plugin-proxy : 1.5.8
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0

```

global packages:

```
cordova (Cordova CLI) : 7.1.0

```

local packages:

```
@ionic/app-scripts : 3.1.2
Cordova Platforms : android 6.3.0 ios 4.4.0
Ionic Framework : ionic-angular 3.9.2

```

System:

```
Android SDK Tools : 26.1.1
Node : v9.4.0
npm : 5.8.0
OS : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145

```

Environment Variables:

```
ANDROID_HOME : /Users/simonesummo/Library/Android/sdk/
HTTP_PROXY : not set
http_proxy : not set
HTTPS_PROXY : not set
https_proxy : not set
IONIC_HTTP_PROXY : not set
PROXY : not set
proxy : not set

```

Misc:

```
backend : pro

```
