iOS simulator linker command failed

2019-08-08 18:18发布

I am trying to launch my iOS app on the simulator but it does not work. Running the app on the phone works normally though. It has something to do with my admon integration. Before the simulator was running smoothly. I am using Xcode 6.1.

I added all required frameworks:

AdSupport  
AudioToolbox  
AVFoundation  
CoreGraphics  
CoreTelephony  
EventKit
EventKitUI 
MessageUI
StoreKit
SystemConfiguration
as well as libGoogleAdMobAds.a

The error I get is:

ld: warning: ignoring file /Users/XXXXXXX/Documents/app1/app1/AdSupport.framework/AdSupport, missing required architecture i386 in file /Users/XXXXXXX/Documents/app1/app1/AdSupport.framework/AdSupport (3 slices)
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
      objc-class-ref in libGoogleAdMobAds.a(GADDevice.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

3条回答
Explosion°爆炸
2楼-- · 2019-08-08 19:01

The library most probably does not contains any i386 binary slice. It probably contains slices for devices -- 3 "iPhone" architectures: armv7, armv7s, arm64 -- but not the simulator architecture, which runs on your computer. Since the binary slice can't be found, the linker is missing symbols to make the i386 executable, and it can't be run in the simulator.

查看更多
该账号已被封号
3楼-- · 2019-08-08 19:13

Go to "info" in project settings and clear library search paths, and then re-add the libGoogleAdMobAds.a framework

查看更多
叛逆
4楼-- · 2019-08-08 19:16

Where did you get the AdSupport.framework from? I now realize it's in your Documents directory.

Normally you should link the target from Xcode, by going in the target settings:

enter image description here

then Build phases > Link binary with libraries:

enter image description here

search for "AdSupport", it should be under iOS8.1:

enter image description here

the library should be there:

enter image description here

查看更多
登录 后发表回答