简体   繁体   中英

iOS - Why build failed on simulator, but success on device/Generic iOS Device?

I have a doubt, when we set target device and build a normal working project then it builds success, but same project when I change target to simulator OR Generic iOS Device then it fails. I have shared screen shot for error details when I build a working project on simulator. What's the reason behind this why same code builds + runs perfectly on iphone devices OR Generic iOS Device, On the other hand fails on simulator? Please note that, I have added already necessary Framework in my project. Any suggestion will be great. Thanks guys.

http://i.stack.imgur.com/CJTim.png

it means the supporting frameworks are missed

for _OBJC_CLASS_$_SKStoreProductViewController

add StoreKit framework

for _OBJC_CLASS_$_asidentifiermanager

add AdSupport.framework

for _OBJC_CLASS_$_CMMotionManager

add

CoreMotion.framework

Whenever you encounter such issue, I recommend on using the 'lipo' tool of Apple. you call it like this:

/usr/bin/lipo -i <path-to-libraray-file>.a

The response will be:

Architectures in the fat file: <the-lib>.a are: armv7 arm64 

I guess that in your case, the library which provides the ASIdentifierManager will only show armv7 and arm64 which are required to run on real devices, but not i386 required for the simulator.

So the question is where this library is coming from. If you got it from a 3rd party, ask them to provide a 'fat' library which include all the required architectures, including one for i386

Your mac (simulator) running on i386 architecture. If you compile your static libraries for i386 as well you will be able to use them on the simulator.

Try adding "i386" to the "Valid Architectures"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM