Error: “File was built for archive which is not the architecture being linked (armv7s)”

后端 未结 7 416
盖世英雄少女心
盖世英雄少女心 2020-12-23 11:04

I have built my own Static C++ Library, which is built with the settings:

  • Architectures: armv7, armv7s
  • Build Active Architectures Only: No
  • Su
相关标签:
7条回答
  • 2020-12-23 11:31

    I use XCode 5.1.1 and ran into the described problem. A more convenient way to solve this problem seems to be just to create an Archive (via menu Build/Archive) and distribute it. The distributed lib file will contain all defined architectures.

    0 讨论(0)
  • 2020-12-23 11:32

    one additional notes is:

        Build Active Architectures Only  set to no
    

    is for the lib project.

    0 讨论(0)
  • 2020-12-23 11:37

    unfortunately all these pieces of advice don't work for me - Xcode 7.3.1 (7D1014), iPhone 5. but as soon as I removed all Xcode temporary files (+ restart Xcode) and rebuild again it became working.

    0 讨论(0)
  • 2020-12-23 11:39

    I have got the exact same error when with cocapods : For me the solution was to have two differents Build Active Architecture for target and pods.

    App Target :

    Build Active Architectures Only  **Yes**
    

    pods Target

    Build Active Architectures Only  **No**
    
    0 讨论(0)
  • 2020-12-23 11:40

    It did happen to me with Facebook SDK (v 4.24.0) used via CocoaPods.

    Cleanning or setting Build Active Architectures Only to NO on Pods didn't resolve the problem.

    The solution was to empty the build directory (see Build settings/Build locations/CONFIGURATION_BUILD_DIR) OR $(CONFIGURATION_BUILD_DIR) Xcode variable.

    0 讨论(0)
  • 2020-12-23 11:44

    When you're building a library you must compile it both for the simulator and the device and then merge the two outputs (.a files) into 1 library and then link it to your iOS project.

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