简体   繁体   中英

How to fix ionic 2 Apple Mach-O Linker error?

I'm building an ionic 2 app, and I can build the app with ionic build ios and I get no erros, but on xcode when I build my application I get the following error.

Apple Mach-O Linker (id) Error Linker command failed with exit code 1 (use -v to see invocation).

How can I fix this?

Here is my system information

Cordova CLI: 6.5.0

Ionic Framework Version: 2.3.0

Ionic CLI Version: 2.2.2

Ionic App Lib Version: 2.2.1

Ionic App Scripts Version: 1.1.4

ios-deploy version: 1.9.0

OS: macOS Sierra

Node Version: v6.9.4

Xcode Version: Xcode 8.3 Build version 8E162

You are probably opening the .xcodeproj on Xcode, try opening the .xcworkspace . This fixed this error for me.

Had the same issue, spent almost a day trying to figure out what was causing it. For me the following solved it. Everything was working fine on ios@4.3.1, but on 4.5.3, I got this annoying error.

Check if this plugin " cordova-plugin-console " is there in the plugins folder. If it is there, remove it. Then it started building without any errors.

ionic cordova plugin remove cordova-plugin-console

Look for a file named libPods-AppName.a in Frameworks directory where AppName is your app name.

Deleting it fixes it in most cases.

Take a look at the screenshot for reference.

Quick Fix

Disclaimer: My project uses Ionic v1

I had the same error and, once I had added a Android-only plugin, I thought that it was the cause of the error - I was wrong (so, ignore this cause if you think the same as I).

After some search I found the truly cause of the error: the cordova-ios version (4.5). I followed the steps suggested here and I solve this issue.

Steps:

ionic cordova platform remove ios
ionic cordova platform add ios@4.4.0
ionic cordova platform

Last step is used to check if ios@4.4.0 is actually the installed version.

Hope it helps.

In your platforms folder for ios, there are both .xcodeproj and .xcworkspace files. Open the /platforms/ios/.xcworkspace.

I found the issue that was causing this error.

On the config.xml file on the tag I had the email with my@email.com and you cannot have the .com on the email. I removed and it works fine now.

Thanks for the help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM