Android IMA SDK [ Error: Attempted to send bridge message after cleanup ]

119 views
Skip to first unread message

gourav...@gmail.com

unread,
Dec 2, 2020, 1:53:05 AM12/2/20
to Interactive Media Ads SDK
Hi There,

I am using 3.21.2 IMA android SDK. I tried master branch of IMA Advanced Example.

In our code, on ALL_ADS_COMPLETED event, we used to destroy adDisplayContainer but in the latest sdk versions, this API is deprecated and instead we need to use adsLoader.release and as per the documentation; this is recommended to call when i get  ALL_ADS_COMPLETED event.

But in IMA sample, i can see only adsManager is being destroyed so i thought of keeping adsLoader.release() there; but after this i am getting the following error in ADB. Please check the screenshot as well.

2020-12-02 12:15:07.131 9198-9198/com.google.ads.interactivemedia.v3.samples.videoplayerapp E/IMASDK: Error: Attempted to send bridge message after cleanup: JavaScriptMessage [command=videoDisplay1, type=pause, sid=10474e0e-0d7f-4dee-a4ba-dadccd213abf, data=null]; javascript:adsense.mobileads.afmanotify.receiveMessage('videoDisplay1', {"type":"pause","sid":"10474e0e-0d7f-4dee-a4ba-dadccd213abf"});
2020-12-02 12:15:07.135 9198-9198/com.google.ads.interactivemedia.v3.samples.videoplayerapp E/IMASDK: Error: Attempted to send bridge message after cleanup: JavaScriptMessage [command=adsManager, type=destroy, sid=10474e0e-0d7f-4dee-a4ba-dadccd213abf, data=null]; javascript:adsense.mobileads.afmanotify.receiveMessage('adsManager', {"type":"destroy","sid":"10474e0e-0d7f-4dee-a4ba-dadccd213abf"});

Screenshot 2020-12-02 at 12.15.58 PM.png

gourav...@gmail.com

unread,
Dec 2, 2020, 3:27:04 AM12/2/20
to Interactive Media Ads SDK
Hi,

It is not causing any known side effect as far i checked but don't know the reason behind it and certainly not sure the future impacts of it. 

Prior to 3.21.0 version, we were calling adDisplayContainer.destroy() and then adsManager.destroy() but after this change in 3.21.0 onwards, adDisplayContainer.destroy() is not there and instead we need to use adsLoader.release() [ I can see inside obfuscated code that in this release method, IMA SDK internally calling adDisplayContainer.destroy() ]

So not sure what should be the correct flow now, 

1. Should I not call adsLoader.release at the time of ALL_ADS_COMPLETED event ? This is what it is in IMA Advanced Example as well.
2. OR there is an underlying bug because of which i am seeing this error 

IMA SDK

unread,
Dec 2, 2020, 3:47:07 AM12/2/20
to gourav...@gmail.com, ima...@googlegroups.com

Hi Gourav,

Thank you for reporting this issue. I was able to replicate the error messages that you are seeing using the information that you’ve shared earlier. I’ll check this together with my teammates and will give you an update as soon as we have our findings.


Regards,


Google Logo
Sherwin Diesta
IMA SDK Team
 


ref:_00D1U1174p._5004Q28mSMt:ref

Gourav Saxena

unread,
Dec 2, 2020, 4:42:05 AM12/2/20
to IMA SDK, ima...@googlegroups.com
Thanks Sherwin.

-
Gourav

Gourav Saxena

unread,
Dec 6, 2020, 10:18:41 AM12/6/20
to IMA SDK, ima...@googlegroups.com
Hi Sherwin,

Please let me know if you have any updates from the team.

Regards,
Gourav

IMA SDK

unread,
Dec 7, 2020, 1:44:32 AM12/7/20
to gourav...@gmail.com, ima...@googlegroups.com

Hi Gourav,

Thanks for following up.

The team confirms that this warning is occurring, however it is harmless and can be ignored. Next update of the Android SDK should remove this warning, you can keep an eye on our release history for updates. Also, the ALL_ADS_COMPLETED event is an acceptable place to call adsLoader.release().


Regards,

Gourav Saxena

unread,
Dec 7, 2020, 4:49:55 AM12/7/20
to IMA SDK, ima...@googlegroups.com
Hi Sherwin,

Thanks for your response. I will wait for the next release. :) 

Regards,
Gourav

IMA SDK

unread,
Dec 10, 2020, 7:42:27 AM12/10/20
to gourav...@gmail.com, ima...@googlegroups.com

Hi Gourav,

The SDK version 3.21.4 has been released with the fix below. Let me know if this version would solve the issue on your end.

- Removes a harmless warning message related to calling adsLoader.release() after the webview has been destroyed.


Regards,


Gourav Saxena

unread,
Dec 10, 2020, 9:18:28 AM12/10/20
to IMA SDK, ima...@googlegroups.com
Thanks a lot Sherwin. I will surely check it and let you know.

Regards,
Gourav

Gourav Saxena

unread,
Dec 11, 2020, 1:41:01 AM12/11/20
to IMA SDK, ima...@googlegroups.com
Hi Sherwin,

I checked it in 3.21.4 and still see this log and now it is in the Error category.

You can do the same by going BG/FG. Scenario is following in IMA Advanced example app,

1. Configure this ad. It has pre/mid/post ads


2. when the pre roll is playing, do BG/FG.
3. Once pre roll ends, seek to the end and now when the ads are playing go to BG/FG.
4. Once postroll completes, you will see the errors.
5. Strange thing is now that this error persists on the replay of the media as well. 

2020-12-11 12:02:15.209 17338-17338/com.google.ads.interactivemedia.v3.samples.videoplayerapp E/IMASDK: Error: Attempted to send bridge message after cleanup: JavaScriptMessage [command=contentTimeUpdate, type=contentTimeUpdate, sid=a3f6404b-2f1a-485c-840e-4c717c210f73, data=TimeUpdateData{currentTime=0, duration=60070, timeUnit=ms}]; javascript:adsense.mobileads.afmanotify.receiveMessage('contentTimeUpdate', {"type":"contentTimeUpdate","sid":"a3f6404b-2f1a-485c-840e-4c717c210f73","data":{"currentTime":0,"duration":60070,"timeUnit":"ms"}});

Please check the attached adb logs.

Regards,
Gourav

3_21_4_IMAADS_Error.rtf

IMA SDK

unread,
Dec 11, 2020, 4:29:18 AM12/11/20
to gourav...@gmail.com, ima...@googlegroups.com

Hi Gourav,

Thank you for your confirmation and for sharing this information. I’m going to check this with the team and will let you know for any feedback.


Regards,


Gourav Saxena

unread,
Dec 11, 2020, 4:33:16 AM12/11/20
to IMA SDK, ima...@googlegroups.com
Great, thanks for the update Sherwin.

Regards,
Gourav

Gourav Saxena

unread,
Dec 16, 2020, 12:48:55 AM12/16/20
to IMA SDK, ima...@googlegroups.com
Hi Sherwin,

Please let me know if you have any update.

Regards,
Gourav

IMA SDK

unread,
Dec 16, 2020, 2:35:42 AM12/16/20
to gourav...@gmail.com, ima...@googlegroups.com

Hi Gourav,

At the moment we do not have an update yet, but I’m going to check this with the team. I’ll let you know for any feedback.


Regards,


Gourav Saxena

unread,
Dec 16, 2020, 3:22:05 AM12/16/20
to IMA SDK, ima...@googlegroups.com
Sure Sherwin. Thank you for the update.


Regards,
Gourav

Gourav Saxena

unread,
Jan 5, 2021, 1:19:11 AM1/5/21
to IMA SDK, ima...@googlegroups.com
Hi Sherwin,

Hope you are doing good. 

Please let me know if you have any updates from the team.

Regards,
Gourav

IMA SDK

unread,
Jan 5, 2021, 3:59:55 AM1/5/21
to gourav...@gmail.com, ima...@googlegroups.com

Hi Gourav,

I appreciate your patience and understanding on this matter. However, I’m afraid we do not have any update at this moment. But let me check this with the team and will let you know for any updates.


Regards,


Gourav Saxena

unread,
Jan 5, 2021, 5:54:54 AM1/5/21
to IMA SDK, ima...@googlegroups.com
Sure Sherwin, thanks for the update. 

Regards,
Gourav

Gourav Saxena

unread,
Jan 13, 2021, 12:47:18 AM1/13/21
to IMA SDK, ima...@googlegroups.com
Hi Sherwin,

Please let me know if this issue is fixed in 3.22.0.

I am seeing one error in 3.22.0 and 3.21.2, it may require some flow change. 

Can you please suggest what change is required ? Earlier we were reusing DisplayContainer on changing the media. Now do we need to use a fresh instance of DisplayContainer every time on change media.

java.lang.IllegalArgumentException: A given DisplayContainer may only be used once
        at com.google.ads.interactivemedia.v3.internal.arm.b(IMASDK:1)
        at com.google.ads.interactivemedia.v3.internal.anp.claim(IMASDK:1)
        at com.google.ads.interactivemedia.v3.internal.ane.<init>(IMASDK:13)
        at com.google.ads.interactivemedia.v3.internal.ane.<init>(IMASDK:1)x
        at com.google.ads.interactivemedia.v3.api.ImaSdkFactory.createAdsLoader(IMASDK:6)

Regards,
Gourav

Gourav Saxena

unread,
Jan 13, 2021, 1:55:22 AM1/13/21
to IMA SDK, ima...@googlegroups.com
I am using adsLoader.release() and as per definition 
"Frees resources from the BaseDisplayContainer as well as the underlying WebView. This should occur after disposing of the BaseManager using BaseManager.destroy() and after the manager has finished its own cleanup, as indicated by AdEvent.AdEventType.ALL_ADS_COMPLETED"

If I use a fresh instance of adDisplayContainer on change media then in the next media, i don't see Ad Video Frame, only Ad audio and ad timer, learnmore (UI ) is visible.

Regards,
Gourav

IMA SDK

unread,
Jan 13, 2021, 3:01:29 AM1/13/21
to gourav...@gmail.com, ima...@googlegroups.com

Hi Gourav,

Thanks for bringing this to our attention. For our test reference, could you share with us a sample project file demonstrating this exception error? This could be a new issue that is not related to the one you’ve reported initially.


Regards,

gourav...@gmail.com

unread,
Jan 13, 2021, 5:19:16 AM1/13/21
to Interactive Media Ads SDK
Hi Sherwin,

I have raised the query to another ticket: https://groups.google.com/g/ima-sdk/c/xyGgGW4_YaM

IMA SDK

unread,
Jan 13, 2021, 11:05:40 AM1/13/21
to gourav...@gmail.com, ima...@googlegroups.com
Hi Gourav,

Thank you for the response back. Wanted to let you know that we will reach out to you on the other thread. So as to continue it on that post. I will Also make sure that the other post is associated with this post.

Regards,
Google Logo
William Pescherine
IMA SDK Team
 


ref:_00D1U1174p._5004Q28mSMt:ref

Gourav Saxena

unread,
Jan 13, 2021, 11:06:45 AM1/13/21
to IMA SDK, Interactive Media Ads SDK
Sure. Thanks for the update.
Reply all
Reply to author
Forward
0 new messages