Xcode: Conditional Build Settings based on architecture (Device (ARM) vs Simulator (i386))

前端 未结 7 1623
陌清茗
陌清茗 2020-12-07 23:22

I\'m building an iPhone app that has to run on both the simulator and the device. However I\'m using an externally compiled library that has one version for the simulator an

7条回答
  •  一向
    一向 (楼主)
    2020-12-07 23:35

    For someone comes across the warning like "[lib_for_sim_or_device] not not built for the architecture ...", the warning arises when dragging the 3rd party library folder into the project.

    Behind the scene the XCode automatically add the library files into 'target setting -> Build Phrases -> Link Binary with Libraries' sections, which causes linking with both libraries.

    To fix that, remove those entries from 'Link Binary with Libraries', and then follow the guide above on conditional building setting for sim/device'

    Hope it helps!

提交回复
热议问题