[NSConcreteNotification imaMessage]: unrecognized selector sent to instance

1,181 views
Skip to first unread message

Mohamed ali CHAABANI

unread,
Aug 29, 2015, 4:27:06 PM8/29/15
to Interactive Media Ads SDK
Hi, i integrate IMA in my static library that i use in a demo application.

When i request ads the application crash with this error :

-[NSConcreteNotification imaMessage]: unrecognized selector sent to instance 0x7fcca36ae230

2015-08-29 22:23:42.567 MBPlayerDemo[43916:1949301] Uncaught exception -[NSConcreteNotification imaMessage]: unrecognized selector sent to instance 0x7fcca36ae230

2015-08-29 22:23:42.609 MBPlayerDemo[43916:1949301] Stack trace: (

0   CoreFoundation                      0x00000001022efc65 __exceptionPreprocess + 165

1   libobjc.A.dylib                     0x0000000101873bb7 objc_exception_throw + 45

2   CoreFoundation                      0x00000001022f70ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205

3   CoreFoundation                      0x000000010224d13c ___forwarding___ + 988

4   CoreFoundation                      0x000000010224ccd8 _CF_forwarding_prep_0 + 120

5   MBPlayerDemo                        0x0000000100c14212 -[IMAJavascriptBridge handleMessageInitialized:] + 157

6   CoreFoundation                      0x00000001022bf54c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12

7   CoreFoundation                      0x00000001021bda04 _CFXNotificationPost + 2484

8   Foundation                          0x00000001013ca968 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66

9   MBPlayerDemo                        0x0000000100c15a9e -[IMAJavascriptSession didReceiveMessage:] + 316

10  MBPlayerDemo                        0x0000000100c14e47 -[IMAJavascriptDispatcher processNewMessage:] + 310

11  MBPlayerDemo                        0x0000000100c14a1e -[IMAJavascriptDispatcher processNewMessageWithChannelName:data:] + 144

12  MBPlayerDemo                        0x0000000100c144f2 -[IMAJavascriptBridge webView:didReceiveMessage:] + 165

13  MBPlayerDemo                        0x0000000100c2723d -[IMAWKWebView userContentController:didReceiveScriptMessage:] + 164

14  WebKit                              0x0000000100e8379e _ZN28ScriptMessageHandlerDelegate14didPostMessageERN6WebKit12WebPageProxyERNS0_13WebFrameProxyERN7WebCore21SerializedScriptValueE + 434

15  WebKit                              0x0000000100f04049 _ZN6WebKit29WebUserContentControllerProxy14didPostMessageEPN3IPC10ConnectionEyyyRKNS1_13DataReferenceE + 203

16  WebKit                              0x0000000100e676f4 _ZN3IPC13handleMessageIN8Messages29WebUserContentControllerProxy14DidPostMessageEN6WebKit29WebUserContentControllerProxyEMS5_FvPNS_10ConnectionEyyyRKNS_13DataReferenceEEEEvS7_RNS_14MessageDecoderEPT0_T1_ + 134

17  WebKit                              0x0000000100ddf048 _ZN3IPC18MessageReceiverMap15dispatchMessageEPNS_10ConnectionERNS_14MessageDecoderE + 120

18  WebKit                              0x0000000100f1de1a _ZN6WebKit15WebProcessProxy17didReceiveMessageEPN3IPC10ConnectionERNS1_14MessageDecoderE + 24

19  WebKit                              0x0000000100d66d5a _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_14MessageDecoderENS1_14default_deleteIS3_EEEE + 94

20  WebKit                              0x0000000100d69774 _ZN3IPC10Connection18dispatchOneMessageEv + 110

21  JavaScriptCore                      0x0000000105459436 _ZN3WTF7RunLoop11performWorkEv + 454

22  JavaScriptCore                      0x0000000105459cea _ZN3WTF7RunLoop11performWorkEPv + 26

23  CoreFoundation                      0x0000000102223431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

24  CoreFoundation                      0x00000001022192fd __CFRunLoopDoSources0 + 269

25  CoreFoundation                      0x0000000102218934 __CFRunLoopRun + 868

26  CoreFoundation                      0x0000000102218366 CFRunLoopRunSpecific + 470

27  GraphicsServices                    0x000000010497ba3e GSEventRunModal + 161

28  UIKit                               0x0000000102efd900 UIApplicationMain + 1282

29  MBPlayerDemo                        0x0000000100c09bde main + 142

30  libdyld.dylib                       0x0000000107de9145 start + 1

31  ???                                 0x0000000000000001 0x0 + 1

)

Tyler Sidell (IMA SDK Team)

unread,
Aug 31, 2015, 10:17:40 AM8/31/15
to Interactive Media Ads SDK
Hi, 

Thank you for sending your stack trace.   It looks like you are using a custom player, MBPlayerDemo.  I just have a couple of questions to clarify the issue that you are experiencing:
  • Would you be able to provide additional steps necessary in order for us to try to reproduce this issue?  
  • If you can provide some code snippets and details of your implementation that may be helpful as well. 
  • Also, have you experienced this issue with our sample examples?  
Thanks,
Tyler Sidell
IMA SDK Team

Somya Jain

unread,
Dec 30, 2015, 12:34:42 PM12/30/15
to Interactive Media Ads SDK
Hi Tyler, 

I just tried out the sample examples->Swift->Basic Example and am seeing the same issue( Xcode Version 7.2, ios 9.2)

Please, let me know of there is any more info that I can provide. 

Thanks

Somya

Tyler Sidell (IMA SDK Team)

unread,
Dec 30, 2015, 4:49:38 PM12/30/15
to Interactive Media Ads SDK
Hi Somya,

Can you please send us the answers to the questions proposed:
    • Would you be able to provide additional steps necessary in order for us to try to reproduce this issue? 
    • If you can provide some code snippets and details of your implementation that may be helpful as well. 
    • Does this prevent ad playback or crash your app?
    If you can send us reproducible steps along with sample code snippets, that would be helpful to troubleshoot if there is a crash.


    Thanks,
    Tyler Sidell
    IMA SDK Team

    Somya Jain

    unread,
    Dec 31, 2015, 9:45:21 AM12/31/15
    to Interactive Media Ads SDK
    Hi Tyler, 

    I've posted my version of the sample here here. I didn't really change anything other than add a static reference to the Ads Framework as I'm also experiencing the same issue as this with the pods: https://groups.google.com/forum/#!topic/ima-sdk/2zDvx_KYHdo

    Also, yes this is crashing the sample app. Look forward to your feedback. 

    Thanks
    Somya

    Tyler Sidell (IMA SDK Team)

    unread,
    Jan 4, 2016, 9:55:36 AM1/4/16
    to Interactive Media Ads SDK
    Hi Somya,

    Did you intend to include an attachment to your sample?  That did not seem to be attached.

    Thanks,
    Tyler Sidell
    IMA SDK Team

    Somya Jain

    unread,
    Jan 4, 2016, 3:07:49 PM1/4/16
    to Interactive Media Ads SDK
    Hi Tyler,

    My apologies. Here is the link: https://github.com/somya/googleads-ima-ios 

    Tyler Sidell (IMA SDK Team)

    unread,
    Jan 4, 2016, 5:33:30 PM1/4/16
    to Interactive Media Ads SDK
    Hi Somya,

    Thank you for sending over your Github project.  I also was able to see the error messages that you received, "Include of non-modular header inside framework module 'GoogleInteractiveMediaAds".  Have you tried following the instructions outlined in this thread?  This could also be related to an issue with XCode 7.1+.  Have you tried adding the headers manually instead of using Cocoapods?  Another suggestion would be to go to Build Settings -> Allow Non-Module includes in Framework Modules is set to 'Yes', clean project, then build.

    Also, after I fixed the headers on the example I was not able to reproduce the crash that you are describing.  Can you provide step-by-step analysis so that we can try to capture the behavior on our end?  In addition, feel free to send over stack traces if you have them.

    Thanks,
    Tyler Sidell
    IMA SDK Team

    Scott McCoy

    unread,
    Jan 8, 2016, 8:40:18 PM1/8/16
    to Interactive Media Ads SDK
    I'm getting the same issue. It doesn't look like a header issue because the project is compiling just fine. When it runs, though, I get the same crash:




    2016-01-08 17:19:15.423 StartDelay[81156:12155175] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteNotification imaMessage]: unrecognized selector sent to instance 0x7fcd0b30e3c0'

    *** First throw call stack:

    (

    0   CoreFoundation                      0x00000001017fae65 __exceptionPreprocess + 165

    1   libobjc.A.dylib                     0x000000010400edeb objc_exception_throw + 48

    2   CoreFoundation                      0x000000010180348d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205

    3   CoreFoundation                      0x000000010175090a ___forwarding___ + 970

    4   CoreFoundation                      0x00000001017504b8 _CF_forwarding_prep_0 + 120

    5   StartDelay                          0x0000000100be7921 -[IMAJavascriptBridge handleMessageInitialized:] + 157

    6   CoreFoundation                      0x00000001017c769c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12

    7   CoreFoundation                      0x00000001017c73db _CFXRegistrationPost + 427

    8   CoreFoundation                      0x00000001017c7142 ___CFXNotificationPost_block_invoke + 50

    9   CoreFoundation                      0x000000010180c972 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986

    10  CoreFoundation                      0x00000001016c2279 _CFXNotificationPost + 633

    11  Foundation                          0x0000000101dad109 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66

    12  StartDelay                          0x0000000100be94a2 -[IMAJavascriptSession didReceiveMessage:] + 304

    13  StartDelay                          0x0000000100be8838 -[IMAJavascriptDispatcher processNewMessage:] + 310

    14  StartDelay                          0x0000000100be83fb -[IMAJavascriptDispatcher processNewMessageWithChannelName:data:] + 144

    15  StartDelay                          0x0000000100be7e63 -[IMAJavascriptBridge webView:didReceiveMessage:] + 165

    16  StartDelay                          0x0000000100c00129 -[IMAWKWebView userContentController:didReceiveScriptMessage:] + 164

    17  WebKit                              0x0000000103c63299 _ZN28ScriptMessageHandlerDelegate14didPostMessageERN6WebKit12WebPageProxyERNS0_13WebFrameProxyERKNS0_18SecurityOriginDataERN7WebCore21SerializedScriptValueE + 217

    18  WebKit                              0x0000000103c0e4ef _ZN6WebKit29WebUserContentControllerProxy14didPostMessageERN3IPC10ConnectionEyyRKNS_18SecurityOriginDataEyRKNS1_13DataReferenceE + 221

    19  WebKit                              0x0000000103c101e4 _ZN3IPC13handleMessageIN8Messages29WebUserContentControllerProxy14DidPostMessageEN6WebKit29WebUserContentControllerProxyEMS5_FvRNS_10ConnectionEyyRKNS4_18SecurityOriginDataEyRKNS_13DataReferenceEEEEvS7_RNS_14MessageDecoderEPT0_T1_ + 142

    20  WebKit                              0x0000000103a6ee95 _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_14MessageDecoderE + 113

    21  WebKit                              0x0000000103bf1b8c _ZN6WebKit15WebProcessProxy17didReceiveMessageERN3IPC10ConnectionERNS1_14MessageDecoderE + 24

    22  WebKit                              0x0000000103a2cdca _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_14MessageDecoderENS1_14default_deleteIS3_EEEE + 102

    23  WebKit                              0x0000000103a2f092 _ZN3IPC10Connection18dispatchOneMessageEv + 114

    24  JavaScriptCore                      0x000000010d178b05 _ZN3WTF7RunLoop11performWorkEv + 437

    25  JavaScriptCore                      0x000000010d1791e2 _ZN3WTF7RunLoop11performWorkEPv + 34

    26  CoreFoundation                      0x0000000101726a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

    27  CoreFoundation                      0x000000010171c95c __CFRunLoopDoSources0 + 556

    28  CoreFoundation                      0x000000010171be13 __CFRunLoopRun + 867

    29  CoreFoundation                      0x000000010171b828 CFRunLoopRunSpecific + 488

    30  GraphicsServices                    0x0000000104fb7ad2 GSEventRunModal + 161

    31  UIKit                               0x00000001024ef610 UIApplicationMain + 171

    32  StartDelay                          0x0000000100be11dd main + 109

    33  libdyld.dylib                       0x0000000106d1e92d start + 1

    34  ???                                 0x0000000000000001 0x0 + 1

    )

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

    Tyler Sidell (IMA SDK Team)

    unread,
    Jan 11, 2016, 11:50:33 AM1/11/16
    to Interactive Media Ads SDK
    Hi Scott, 

    Thank you for reporting this crash.  May I suggest adding the library manually to see if you are having the same issues?  There is a bug open with Cocoapods about this issue.  In the meantime, I'll speak to the rest of our team to see if there is anything that can be done on our end.

    Cheers,
    Tyler Sidell
    IMA SDK Team

    Jean-Alexandre Iragne

    unread,
    Jan 11, 2016, 12:17:55 PM1/11/16
    to Interactive Media Ads SDK
    to solved add "-objc -all_load" to other linker flags

    Scott McCoy

    unread,
    Jan 11, 2016, 10:12:43 PM1/11/16
    to ima...@googlegroups.com
    The linker flag fixed things for me.

    Sent from my iPhone
    --
    You received this message because you are subscribed to a topic in the Google Groups "Interactive Media Ads SDK" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/ima-sdk/xbz33qCr1Ik/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.
    To post to this group, send email to ima...@googlegroups.com.
    Visit this group at https://groups.google.com/group/ima-sdk.
    For more options, visit https://groups.google.com/d/optout.

    Girish Muchalambe

    unread,
    Feb 5, 2016, 3:35:35 AM2/5/16
    to Interactive Media Ads SDK
    Hi,

    I was able to solve the crash issue after setting the linker flag to "-all_load".

    But when I added the "GoogleMobileAds.framework", app won't compile due "-all_load" linker flag. 
    Can I add Admob and IMA in my project? Or any solution to solve the compilation issue?

    Veer Arjun Busani

    unread,
    Feb 5, 2016, 12:24:08 PM2/5/16
    to Interactive Media Ads SDK
    Hi Girish,

    I believe the issue that you are facing is due to duplicate symbols being used by both the IMA and Mobile Ads SDK. Here is how I would suggest you to setup your project to include both the SDK's - 
    • First download the sample project for IMA. For this example, download the Basic Example for SWIFT. Next update the pod file to only include this - pod 'GoogleAds-IMA-iOS-SDK-For-AdMob' . Basically this pod would include both the IMA and AdMob SDK and would fix your duplicate symbols issue.
    • Next, the IDE would still likely throw the 'non-modular' error. The simplest way to fix this without changing the Linker Flags would be to open in Xcode -> Pods -> Pods -> GoogleAds-IMA-iOS-SDK-For-AdMob -> Frameworks -> GoogleInteractiveMediaAds.framework -> Headers -> GoogleInteractiveMediaAds.h and change it to the following -
    #import "IMAAVPlayerContentPlayhead.h"
    #import "IMAAVPlayerVideoDisplay.h"
    #import "IMAAd.h"
    #import "IMAAdDisplayContainer.h"
    #import "IMAAdError.h"
    #import "IMAAdEvent.h"
    #import "IMAAdPlaybackInfo.h"
    #import "IMAAdPodInfo.h"
    #import "IMAAdsLoader.h"
    #import "IMAAdsManager.h"
    #import "IMAAdsRenderingSettings.h"
    #import "IMAAdsRequest.h"
    #import "IMACompanionAdSlot.h"
    #import "IMAContentPlayhead.h"
    #import "IMAPictureInPictureProxy.h"
    #import "IMASettings.h"
    #import "IMAStreamManager.h"
    #import "IMAStreamRequest.h"
    #import "IMAUiElements.h"
    #import "IMAVideoDisplay.h"
    • Basically we are trying to directly import the header file here in the IMA SDK. That's it.
    I have also attached a sample project that includes both the SDK's. 

    Project: Link

    Thanks,
    Veer Arjun Busani
    Mobile Ads SDK Team
    Reply all
    Reply to author
    Forward
    0 new messages