Unrecognized selector error when upgrading iOS Google Mobile Ads SDK to 7.39 from 7.16

307 views
Skip to first unread message

Alonso Alvarez

unread,
Feb 22, 2019, 2:12:30 PM2/22/19
to Google Mobile Ads SDK Developers

I have a CustomView that is a Subclass of DFPBannerView.

@interface CustomView : DFPBannerView <AdObject, GADBannerViewDelegate>


CustomView has this initializer:

- (id)initWithAdSize:(GADAdSize)size pos:(NSString *)pos

{

   
if (self = [super initWithAdSize:size]) {

        _pos
= pos;

        _size
= size;

        _visible
= YES;

        _obscured
= NO;

       
self.delegate = self;

   
}

   
return self;

}


Before upgrading to the last version (I was using 7.16) everything was working fine. Now im getting this error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CustomView initWithAdSize:]: unrecognized selector sent to instance 0x7ffd55c89740'

Which is called on this line:

if (self = [super initWithAdSize:size]) {

Does anyone has any idea why this is happening? DFPBannerView is a subclass of GADBannerView which have that initializer:

@interface GADBannerView : UIView

#pragma mark Initialization

/// Initializes and returns a banner view with the specified ad size and origin relative to the

/// banner's superview.

- (instancetype)initWithAdSize:(GADAdSize)adSize origin:(CGPoint)origin;

/// Initializes and returns a banner view with the specified ad size placed at its superview's

/// origin.

- (instancetype)initWithAdSize:(GADAdSize)adSize;


mobileadssdk...@google.com

unread,
Feb 22, 2019, 3:41:58 PM2/22/19
to Alonso Alvarez, Google Mobile Ads SDK Developers
Hello there,

Thanks for reaching out to us. Can you please share the complete device logs for us to take a look? Is the app getting crashed or you were just not able to load ad? Can you please add more details about the Ad types and confirm whether you were able to reproduce the issue with our sample apps?

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/38b52ee6-bdf8-4543-a861-36c9a4897f1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alonso Alvarez

unread,
Feb 22, 2019, 3:48:15 PM2/22/19
to google-adm...@googlegroups.com

Hi, thanks for your response. I was able to reproduce my crash on the sample apps in Swift. I created a Customview class that is a DFPBannerView Subclass on BannerTableViewExample.

class CustomView: DFPBannerView {

 

     

   
var pos: String

     

    init
(size: GADAdSize, pos: String) {

       
self.pos = pos

       
super.init(adSize: size)

   
}

     

    required init
?(coder aDecoder: NSCoder) {

        fatalError
("init(coder:) has not been implemented")

   
}

     

}



When I try to initialize CustomView

let customView = CustomView(size: kGADAdSizeBanner, pos: "L")


 I get the following:



2019-02-22 14:41:40.697602-0500 BannerTableViewExample[15042:199687] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BannerTableViewExample.CustomView initWithAdSize:]: unrecognized selector sent to instance 0x7fb03f70da00'

*** First throw call stack:

(

 
0   CoreFoundation                      0x00000001118011bb __exceptionPreprocess + 331

 
1   libobjc.A.dylib                     0x0000000110da7735 objc_exception_throw + 48

 
2   CoreFoundation                      0x000000011181ff44 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132

 
3   UIKitCore                           0x000000011a3f3b4a -[UIResponder doesNotRecognizeSelector:] + 287

 
4   CoreFoundation                      0x0000000111805c34 ___forwarding___ + 772

 
5   CoreFoundation                      0x0000000111807da8 _CF_forwarding_prep_0 + 120

 
6   BannerTableViewExample              0x000000010b35938b $S22BannerTableViewExample06CustomC0C4size3posACSo9GADAdSizeV_SStcfc + 347

 
7   BannerTableViewExample              0x000000010b3548b6 $S22BannerTableViewExample06CustomC0C4size3posACSo9GADAdSizeV_SStcfC + 86

 
8   BannerTableViewExample              0x000000010b35466d $S22BannerTableViewExample0bC10ControllerC11viewDidLoadyyF + 1613

 
9   BannerTableViewExample              0x000000010b3548e4 $S22BannerTableViewExample0bC10ControllerC11viewDidLoadyyFTo + 36

 
10  UIKitCore                           0x0000000119da64e1 -[UIViewController loadViewIfRequired] + 1186

 
11  UIKitCore                           0x0000000119da6940 -[UIViewController view] + 27

 
12  UIKitCore                           0x000000011a3fdc53 -[UIWindow addRootViewControllerViewIfPossible] + 122

 
13  UIKitCore                           0x000000011a3fe36e -[UIWindow _setHidden:forced:] + 294

 
14  UIKitCore                           0x000000011a4115c0 -[UIWindow makeKeyAndVisible] + 42

 
15  UIKitCore                           0x000000011a3be833 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4595

 
16  UIKitCore                           0x000000011a3c3c2f -[UIApplication _runWithMainScene:transitionContext:completion:] + 1623

 
17  UIKitCore                           0x0000000119be24e9 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866

 
18  UIKitCore                           0x0000000119beb29c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153

 
19  UIKitCore                           0x0000000119be2126 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233

 
20  UIKitCore                           0x0000000119be2ae0 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085

 
21  UIKitCore                           0x0000000119be0cb5 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795

 
22  UIKitCore                           0x0000000119be095f -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435

 
23  UIKitCore                           0x0000000119be5a90 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584

 
24  UIKitCore                           0x0000000119be680e _performActionsWithDelayForTransitionContext + 100

 
25  UIKitCore                           0x0000000119be57ef -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221

 
26  UIKitCore                           0x0000000119bea93a -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392

 
27  UIKitCore                           0x000000011a3c244e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515

 
28  UIKitCore                           0x0000000119f66d09 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357

 
29  FrontBoardServices                  0x00000001194f32da -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448

 
30  FrontBoardServices                  0x00000001194fe443 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271

 
31  FrontBoardServices                  0x00000001194fdb3a __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53

 
32  libdispatch.dylib                   0x0000000112812602 _dispatch_client_callout + 8

 
33  libdispatch.dylib                   0x0000000112815b78 _dispatch_block_invoke_direct + 301

 
34  FrontBoardServices                  0x0000000119532ba8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30

 
35  FrontBoardServices                  0x0000000119532860 -[FBSSerialQueue _performNext] + 457

 
36  FrontBoardServices                  0x0000000119532e40 -[FBSSerialQueue _performNextFromRunLoopSource] + 45

 
37  CoreFoundation                      0x0000000111766721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

 
38  CoreFoundation                      0x0000000111765f93 __CFRunLoopDoSources0 + 243

 
39  CoreFoundation                      0x000000011176063f __CFRunLoopRun + 1263

 
40  CoreFoundation                      0x000000011175fe11 CFRunLoopRunSpecific + 625

 
41  GraphicsServices                    0x00000001144591dd GSEventRunModal + 62

 
42  UIKitCore                           0x000000011a3c581d UIApplicationMain + 140

 
43  BannerTableViewExample              0x000000010b352be4 main + 68

 
44  libdyld.dylib                       0x0000000112888575 start + 1

)

libc
++abi.dylib: terminating with uncaught exception of type NSException



My guess is that we are not able to subclass DFPBannerView anymore. Is that true or am I doing something wrong? Thanks for your time.

mobileadssdk...@google.com

unread,
Feb 25, 2019, 1:31:18 PM2/25/19
to Alonso Alvarez, Google Mobile Ads SDK Developers
Hello there,

Yes this is true that you can no longer subclass DFPBannerView. 

Let us know if you need anything else.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Reply all
Reply to author
Forward
0 new messages