Ios SIGSEGV-[GADDelegateManager didReceiveAd]
我在我的iOS应用程序上与谷歌广告暴徒发生了奇怪的崩溃。事故日志如下:Ios SIGSEGV-[GADDelegateManager didReceiveAd],ios,admob,segmentation-fault,Ios,Admob,Segmentation Fault,我在我的iOS应用程序上与谷歌广告暴徒发生了奇怪的崩溃。事故日志如下: SIGSEGV VLPush-[GADDelegateManager didReceiveAd] # Binary Image Name Address Symbol 0 VLPush 0x001e0ba0 testflight_backtrace 1 VLPush 0x001e03dc TFSignalHandler 2 libsystem_platform.dylib 0x3aaa30
SIGSEGV
VLPush-[GADDelegateManager didReceiveAd]
# Binary Image Name Address Symbol
0 VLPush 0x001e0ba0 testflight_backtrace
1 VLPush 0x001e03dc TFSignalHandler
2 libsystem_platform.dylib 0x3aaa3062 _sigtramp
3 VLPush 0x000f202f -[GADDelegateManager didReceiveAd] --------->>>>> CRASH
4 VLPush 0x000e941b -[GADBannerWebViewDelegate webViewDidFinishLoad:]
5 CoreFoundation 0x300ad503 __invoking___
6 CoreFoundation 0x2fff7eba -[NSInvocation invoke]
7 CoreFoundation 0x2fffb652 -[NSInvocation invokeWithTarget:]
8 WebKit 0x388eff7e -[_WebSafeForwarder forwardInvocation:]
9 CoreFoundation 0x300ac070 ___forwarding___
10 CoreFoundation 0x2fffb597 _CF_forwarding_prep_0
11 CoreFoundation 0x300ad503 __invoking___
12 CoreFoundation 0x2fff7eba -[NSInvocation invoke]
13 WebCore 0x37f41b8c _ZL20HandleDelegateSourcePv
14 CoreFoundation 0x3007518a __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
15 CoreFoundation 0x3007465a __CFRunLoopDoSources0
16 CoreFoundation 0x30072e4e __CFRunLoopRun
17 CoreFoundation 0x2ffddce6 CFRunLoopRunSpecific
18 CoreFoundation 0x2ffddaca CFRunLoopRunInMode
19 GraphicsServices 0x34cfe282 GSEventRunModal
20 UIKit 0x3287fa40 UIApplicationMain
21 VLPush 0x000a0fd6 main in main.m on Line 16
22 libdyld.dylib 0x3a988ab6 start
或:
我使用Ad Mob的方式是:
CGRect statusBarRect = [UIApplication sharedApplication].statusBarFrame;
CGRect navigationBarRect = self.navigationController.navigationBar.frame;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// Google AdMob
// Initialize the banner at the bottom of the screen.
CGPoint origin = CGPointMake(SCREEN_WIDTH / 2 - kGADAdSizeLeaderboard.size.width / 2
,
SCREEN_HEIGHT
- kGADAdSizeLeaderboard.size.height
- navigationBarRect.size.height
- 20);
// Use predefined GADAdSize constants to define the GADBannerView.
self.adBanner = [[GADBannerView alloc] initWithAdSize:kGADAdSizeLeaderboard origin:origin];
// Note: Edit SampleConstants.h to provide a definition for kSampleAdUnitID before compiling.
self.adBanner.adUnitID = kADMobBottomBannerPad;
self.adBanner.delegate = self;
self.adBanner.rootViewController = self;
[self.view insertSubview:self.adBanner aboveSubview:self.scrollView];
[self.adBanner loadRequest:[self request]];
- (GADRequest *)request
{
GADRequest *request = [GADRequest request];
// Make the request for a test ad. Put in an identifier for the simulator as well as any devices
// you want to receive test ads.
request.testDevices = @[
// TODO: Add your device/simulator test identifiers here. Your device identifier is printed to
// the console when the app is launched.
GAD_SIMULATOR_ID
];
return request;
}
我正在初始化viewDidLoad中的广告移动。委托方法设置正确。我错过什么了吗
谢谢 这是一个生命周期问题吗?例如,假设您有两个视图,用户可以在它们之间进行制表。如果第一个视图的代理在第二个视图出现时被释放,并且广告系统试图调用不再可用的第一个视图代理,则会发生崩溃
您可以使用NSZombie(模式设置中的运行选项)来检测发布后的使用错误。嗨,Faisal,感谢您的快速回复,我尝试了您的建议,但我无法重现错误。我试着在好的网络,坏的,快速的控制器之间切换,什么都没有。。。你还有其他建议吗?有时当我遇到一个棘手的UI生成崩溃时,我会使用JavaScript可访问性界面来自动使用UI,然后运行一个程序来不断尝试排列和计时。还有猴子测试的概念——脚本随机按下UI和其他相关UI事件。谢谢你的帮助!通过添加_addBanner.delegate=nil解决;在Dealoc内部。我也在谷歌文档里找到了这个,我第一次错过了!
CGRect statusBarRect = [UIApplication sharedApplication].statusBarFrame;
CGRect navigationBarRect = self.navigationController.navigationBar.frame;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// Google AdMob
// Initialize the banner at the bottom of the screen.
CGPoint origin = CGPointMake(SCREEN_WIDTH / 2 - kGADAdSizeLeaderboard.size.width / 2
,
SCREEN_HEIGHT
- kGADAdSizeLeaderboard.size.height
- navigationBarRect.size.height
- 20);
// Use predefined GADAdSize constants to define the GADBannerView.
self.adBanner = [[GADBannerView alloc] initWithAdSize:kGADAdSizeLeaderboard origin:origin];
// Note: Edit SampleConstants.h to provide a definition for kSampleAdUnitID before compiling.
self.adBanner.adUnitID = kADMobBottomBannerPad;
self.adBanner.delegate = self;
self.adBanner.rootViewController = self;
[self.view insertSubview:self.adBanner aboveSubview:self.scrollView];
[self.adBanner loadRequest:[self request]];
- (GADRequest *)request
{
GADRequest *request = [GADRequest request];
// Make the request for a test ad. Put in an identifier for the simulator as well as any devices
// you want to receive test ads.
request.testDevices = @[
// TODO: Add your device/simulator test identifiers here. Your device identifier is printed to
// the console when the app is launched.
GAD_SIMULATOR_ID
];
return request;
}