Apple Mach -O Linker (Id) Error?

45,938

Solution 1

This problem has different solutions , one of them is to set Enable Bitcode to No . ( I don't know why by default it is Yes )

enter image description here

This problem is a ghost like problem . Clearing Cache , Restarting Xcode , Simulator and MAC ,Ensuring proper linking of Frameworks ,Changing app Architecture or , Sometimes just doing nothing can solve this problem .

Solution 2

This issue was connected to "Link Binary With Libraries". I've renamed the target, and there were two .framework files for the Pods. Thus, after removing the outdated one - the issue was solved. enter image description here

Solution 3

For me the scenario was that I removed one of the dependency in my pods which was not required, after removing it I was getting error that the same dependency not found. So I went to delete its entry from the Project >> Build Settings >> other Linker Flags and then selected the same and deleted it as shown below in the Image. After removing from the linker Flags I started getting the Apple Mach -O Linker (Id) Error? and after trying everything for a day I realised the issue lies inside the linker Flags. Where on deleting any dependecy you have to delete the other line name -framework. you can check the below image to get the clarity. Apple Mach -O Linker (Id) Error?

So I suggest to keep an eye on it while deleting the dependecy from the linker flags, do delete the associated -framework too which lies below the dependency name. In my case it was ObjectMapper

Solution 4

If you just installed/ uninstalled a pod you might want to look at this. Here's what worked for me:

  1. First make sure you are opening the .xcworkspace file not the .xcodeproj. But this is probable not what's causing the issue.

  2. Delete the pod that was recently just installed.

  3. In the project directory on Xcode, open the frameworks folder and if the pod which was just removed is still listed there as one recentlyremovedpod.framework, delete it from there also. This step is what made my project compile eventually.

Solution 5

Another possible cause is if you rename one of your targets (why did I do that?) and you're using pods. You end up with a version of your old target name in the Frameworks folder in your main project (not the Pods project), like pods_oldtarget_framework which no longer exists.

Just delete the old version (or name your target back to it's original and delete the new one), and you should be good to go.

Share:
45,938

Related videos on Youtube

Brett A
Author by

Brett A

Updated on July 09, 2022

Comments

  • Brett A
    Brett A almost 2 years

    I am trying to build this xcode workspace which was built from Unity. And after modifying the project a little bit when I getting to the very end of building the project (linking) I get the Apple Mach -O Linker (Id) Error. I can't open the error tab to see what exactly is causing the error. All it says is "Linker command failed with exit code 1 (use -v to see invocation). There are also two Apple Mach -O Linker (Id) Errors which occur but I have no idea how to solve them.

    Any help is greatly appreciated!

    I can't expand these tabs.. this is all I get told This is the warning tab expanded, the two Apple Mach -O Linker (Id) warnings are the same

    • mayo
      mayo almost 7 years
      "I can't open the error tab to see what exactly is causing the error." >> Maybe you can try clicking the right button over the error and then something like 'Show error in..'. If you can go there, it will be helpful post the cause of the error, in order to understand why the linker process failed.
  • Yuyang He
    Yuyang He over 6 years
    How about I have to use the pod? Because have to use the OneSignal to push notification. Could you help me answer my question:stackoverflow.com/questions/46231264/…
  • Yuyang He
    Yuyang He over 6 years
    How about I have to use the pod? Because have to use the OneSignal to push notification. Could you help me answer my question:stackoverflow.com/questions/46231264/…
  • rpbaltazar
    rpbaltazar about 6 years
    Though not related with unity, the error message I faced was the same, using ionic and I ended up here. For me the problem was caused with an updated version of cordova. Removing the platform and adding it again using a downgraded version of cordova solved the problem for me. Downgraded from 4.5.0 to 4.4.0. source: github.com/ionic-team/ionic/issues/12849
  • roy
    roy about 6 years
    one of my case i face same problem , and solved by downgrading version in podfile , thanks for sharing
  • rpbaltazar
    rpbaltazar about 6 years
    Just to add yet another finding, I believe the root cause of my problem was indeed the upgrade to the 4.5 version: github.com/ionic-team/ionic/issues/12942#issuecomment-330893‌​145
  • Loup G
    Loup G over 5 years
    @YuyangHe if you want to use the recently deleted pod, Reinstall it and it should work normally.
  • Soufiane ROCHDI
    Soufiane ROCHDI over 5 years
    The issue appears when Building so the cleaning phase have already been done correctly. By cleaning again this is not gonna change anything
  • user2167877
    user2167877 about 5 years
    It works for me. Apple compiler doesn't provide enough info.