Undefined symbols for architecture arm64

前端 未结 30 1791
南旧
南旧 2020-11-22 08:17

I am getting a Apple Mach-O Linker Error everytime I import a file from CocoaPods.

Undefined symbols for architecture arm64:
  \"_OBJC_CLASS_$_FBSession\", r         


        
相关标签:
30条回答
  • 2020-11-22 09:12

    You need to just remove arm64 from Valid Architecture and set NO to Active Architecture Only . Now just Clean, Build and Run. You will not see this error again.

    :) KP

    0 讨论(0)
  • 2020-11-22 09:13

    The issue is that the cocoapods have not been built for arm64 architecture yet thus they cannot be linked when you build them. Likely you cannot use those packages until they are updated and use that architecture. You can fix the linker error by going to project -> target (your project name) -> build settings and change architectures to standard architectures (armv7, armv7s), and valid architectures to armv7, armv7s.

    Note though, this means you won't get the full power of the 64 bit processor. You said you are building for the 5s, so there may be some reason you need this. If you for some reason absolutely need that power (perhaps you are building a game), and desperately need those files, you could submit a pull request and then recompile the project to arm64 by setting those same fields to arm64 in the files you pulled from the open source projects. But, unless you really need these files to be 64 bit compatible, that seems like a bit of overkill for now.

    EDIT: Some people also reported that setting Build For Active Architectures to YES was also necessary to solve this problem.

    As of 2014-04-28 the setting should look something like this:

    enter image description here

    0 讨论(0)
  • 2020-11-22 09:14

    If your Architectures and Valid Architectures are all right, you may check whether you have added $(inherited) , which will add linker flags generated in pods, to Other Linker Flags as below: enter image description here

    0 讨论(0)
  • 2020-11-22 09:14
    1. Go to target Build Settings.
    2. set BUILD ACTIVE ARCHITECTURE ONLY = NO for both Debug and Release
    3. Build and run
    0 讨论(0)
  • 2020-11-22 09:14

    In my case, I had to look for

    C++ Standard Library and make sure that the libc++ was the one selected.

    0 讨论(0)
  • 2020-11-22 09:15

    This issue occurred for me after installing a pod via Podfile and pod install. After trying a bunch of different fixes I finally just imported the Pod manually (dragging the necessary files into my project) and that solved the problem.

    0 讨论(0)
提交回复
热议问题