当我将AdMobSDK添加到Xcode项目时,
Apple Mach-O Linker error发生。

我有这个代码。

MainViewController.m

#define BANNER_UNIT_ID @"ca-app-pub-79429573xxxxxxxx/78xxxxxxxx"
@interface MainViewController ()
@property (nonatomic) GADBannerView* bannerView_;
@property (nonatomic, strong) UIView *myView;

@end
@implementation MainViewController
@synthesize myView;

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setUpMyView];
}

- (void)setUpMyView
{
    myView = [[UIView alloc]initWithFrame:CGRectMake(0, 60, 320, 508)];
    myView.opaque = NO;
    myView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.0f];
    [self.view addSubview:myView];

    self.bannerView_ = [[GADBannerView alloc]initWithAdSize:kGADAdSizeBanner];
    self.bannerView_.adUnitID = BANNER_UNIT_ID;
    self.bannerView_.rootViewController = self;
    [myView addSubview:self.bannerView_];
    [self.bannerView_ loadRequest:[GADRequest request]];
}


我添加以下框架。

AdSupport
音频工具箱
AVFoundation
CoreGraphics
MessageUI
StoreKit
系统配置

然后出现以下错误。

Apple Mach-O Linker error:
"_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
linker command failed with exit code 1 (use -v to see invocation)


我如何解决它?

谢谢。

最佳答案

您尚未在Admob所需的应用程序中包括CoreTelephony框架。该文档提供有关如何执行此操作的信息。

https://developers.google.com/mobile-ads-sdk/docs/#ios

关于ios - AdMobSDK:Apple Mach-O链接器错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23439100/

10-10 19:48