XCode: Undefined symbols for architecture arm64 er

2019-01-25 20:37发布

In my XCode 5 project I use RestKit for REST communication. Everything works fine with the simulators, but generating the ipa file, I get the following error:

ld: warning: ignoring file /Users/joseph/Library/Developer/Xcode/DerivedData/XXXXXXXXXX-gdwdekevxtdfivfpsnmyykeqhulk/Build/Products/Debug-iphoneos/libRestKit.a, missing required architecture arm64 in file /Users/joseph/Library/Developer/Xcode/DerivedData/XXXXXXXXXXXXX-gdwdekevxtdfivfpsnmyykeqhulk/Build/Products/Debug-iphoneos/libRestKit.a (2 slices)
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RKRelationshipMapping", referenced from:
      objc-class-ref in classname-xxx.o
  "_OBJC_CLASS_$_RKObjectMapping", referenced from:
      objc-class-ref in classname-xxx.o
  "_OBJC_CLASS_$_RKRequestDescriptor", referenced from:
      objc-class-ref in classname-xxx.o
  "_OBJC_CLASS_$_RKObjectManager", referenced from:
      objc-class-ref in classname-xxx.o
  "_OBJC_CLASS_$_RKResponseDescriptor", referenced from:
      objc-class-ref in classname-xxx.o

  "_RKStatusCodeIndexSetForClass", referenced from:
      -[classname-xxx classname-Method] in classname-xxx.o
      -[classname-xxx classname-Method] in classname-xxx.o
      -[classname-xxx classname-Method] in classname-xxx.o
      -[classname-xxx classname-Method] in classname-xxx.o
      -[classname-xxx classname-Method] in classname-xxx.o
  "_RKMIMETypeJSON", referenced from:
      -[classname-xxxinitWithURLBase:timeOut:] in classname-xxx.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation).

If in RestKit project, I change in "Build Settings" -> "Architectures" the "Standard architectures (ARMv7, armv7s)" by Standard architectures (including 64-bit) (ARMv7, armv7s, arm64) option, everything compiles fine . Is this correct?, Does not bring any result, I have to change some other settings.

7条回答
Melony?
2楼-- · 2019-01-25 21:04

You can try to clean up your build folder :

  • Open XCode
  • Click on Product
  • Hold down the Option key and click on "Clean build folder".
  • I hope this will help you.

    查看更多
    叼着烟拽天下
    3楼-- · 2019-01-25 21:15

    In my case i forgot to add sqlite library in my project. After adding library from Linked framework and library the build was successful.

    查看更多
    萌系小妹纸
    4楼-- · 2019-01-25 21:17

    I ran into the same/similar issue implementing AVPictureInPictureController and the issue was that I wasn't linking the AVKit framework in my project.

    The error message was:

    Undefined symbols for architecture armv7:

    "_OBJC_CLASS_$_AVPictureInPictureController", 
    referenced from:
       objc-class-ref in yourTarget.a(yourObject.o)
    ld: symbol(s) not found for architecture armv7
    

    clang: error: linker command failed with exit code 1 (use -v to see invocation) The Solution:

    Go to your Project Select your Target Then, go to Build Phases Open Link Binary With Libraries Finally, just add + the AVKit framework / any other framework. Hopefully this helps someone else running into a similar issue I had.

    查看更多
    姐就是有狂的资本
    5楼-- · 2019-01-25 21:18

    It just means you are building your project also for 64bit (iPhone 5s) and nothing to worry about, see this link for some more explanations: Xcode 5 and iOS 7: Architecture and Valid architectures

    查看更多
    虎瘦雄心在
    6楼-- · 2019-01-25 21:21
    1. Select Restkit project
    2. Set the Build Active Architecture Only to No

    Build Active Architecture Only

    查看更多
    贪生不怕死
    7楼-- · 2019-01-25 21:21

    This worked for me:

    ios sdk 9.3

    into your build setting of app.xcodeproj valid architecture: armv7 armv7s Build Active architecture : No

    Clean and build , worked for me.

    查看更多
    登录 后发表回答