IMA Crashes when using registerFriendlyObstruction

290 views
Skip to first unread message

Toby Bonhof

unread,
Feb 27, 2020, 9:36:12 AM2/27/20
to Interactive Media Ads SDK
Currently implementing IMA SDK 3.17.0 for Android in our Video SDK. Our bussiness case requires us to register obstructions to get viewability measurements. 

Following the guidelines that are available in the official documentation (https://developers.google.com/interactive-media-ads/docs/sdks/android/omsdk) I'm registering the obstructing views as following:

override fun provideFriendlyObstructions(): List<FriendlyObstruction> {
val obstructions = arrayListOf<FriendlyObstruction>()
getTogglePlaybackButton()?.let {
ImaSdkFactory.getInstance().createFriendlyObstruction(
it,
FriendlyObstructionPurpose.VIDEO_CONTROLS,
"This is the player's playback toggle button."
).apply {
obstructions.add(this)
}
}
getToggleFullscreenButton()?.let {
ImaSdkFactory.getInstance().createFriendlyObstruction(
it,
FriendlyObstructionPurpose.VIDEO_CONTROLS,
"This is the player's fullscreen toggle button."
).apply {
obstructions.add(this)
}
}
getToggleMuteButton()?.let {
ImaSdkFactory.getInstance().createFriendlyObstruction(
it,
FriendlyObstructionPurpose.VIDEO_CONTROLS,
"This is the player's mute toggle button."
).apply {
obstructions.add(this)
}
}
return obstructions
}


provideFriendlyObstructions().forEach {
adDisplayContainer?.registerFriendlyObstruction(it)
}



However when an registerFriendlyObstruction is called im getting an IllegalStateException stating the following:

java.lang.IllegalArgumentException: FriendlyObstruction has improperly formatted detailed reason

I'm not really sure what I'm doing wrong here. Or if this is a bug in IMA.


Toby

unread,
Feb 27, 2020, 9:37:59 AM2/27/20
to Interactive Media Ads SDK
Im using the Linear Sample Ad tag supplied from the IMA SDK Documentation.

Toby

unread,
Feb 27, 2020, 9:42:21 AM2/27/20
to Interactive Media Ads SDK
Here's the full stracktrace im getting from IMA SDK 3.17.0 for Android:

 Process: be.persgroep.videoplayer.example, PID: 30626
    java.lang.IllegalArgumentException: FriendlyObstruction has improperly formatted detailed reason
        at com.google.ads.interactivemedia.v3.internal.e.a(IMASDK:68)
        at com.google.ads.interactivemedia.v3.internal.agx.onAdEvent(IMASDK:63)
        at com.google.ads.interactivemedia.v3.internal.afs.a(IMASDK:95)
        at com.google.ads.interactivemedia.v3.internal.afh.a(IMASDK:55)
        at com.google.ads.interactivemedia.v3.internal.agl.a(IMASDK:53)
        at com.google.ads.interactivemedia.v3.internal.agq.b(IMASDK:38)
        at com.google.ads.interactivemedia.v3.internal.agt.shouldOverrideUrlLoading(IMASDK:4)
        at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:83)
        at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(PG:16)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:336)
        at android.os.Looper.loop(Looper.java:174)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

IMA SDK

unread,
Feb 27, 2020, 3:33:19 PM2/27/20
to to...@mychannels.com, ima...@googlegroups.com
Hi Toby,

Thank you for reaching out to us. It seems that you're having issues implementing the FriendlyObstruction viewability feature. Were you able to reproduce the error implementing it the same way as the shown in the guide?

Regards,
Arnaud Casame
IMA SDK Team


ref:_00D1U1174p._5001UXTQej:ref

Toby Bonhof

unread,
Feb 27, 2020, 3:39:24 PM2/27/20
to IMA SDK, ima...@googlegroups.com
Yes, my code example essentially does exactly the same thing.


IMA SDK

unread,
Feb 27, 2020, 6:39:51 PM2/27/20
to to...@mychannels.com, ima...@googlegroups.com
Hi Toby,

With the previous question, I wanted to know if you were able to reproduce the error using our Android AdvancedExample sample app. If yes, can you share the sample with us via the imate...@gmail.com alias?


Regards,
Arnaud Casame
IMA SDK Team 


ref:_00D1U1174p._5001UXTQej:ref

Toby

unread,
Feb 28, 2020, 3:09:39 AM2/28/20
to Interactive Media Ads SDK
Yeah it is easily reproduced in AdanvedExample. What I've done is added the following code to VideoPlayerController.java, line 170.

mAdDisplayContainer.registerFriendlyObstruction(
ImaSdkFactory.getInstance().createFriendlyObstruction(
mPlayButton, FriendlyObstructionPurpose.VIDEO_CONTROLS, "This is the player's play button."
)
);



And yet again the IMA SDK crashes saying:


    java.lang.IllegalArgumentException: FriendlyObstruction has improperly formatted detailed reason

I have sent a zip file file with project to the emailaddress you have wrote down above. Hopefully this can get fixed soon :)
If i can be of any further assistance please let me know.

IMA SDK

unread,
Feb 28, 2020, 6:29:16 AM2/28/20
to to...@mychannels.com, ima...@googlegroups.com

Hi Toby,

 

I work with Arnaud and will be assisting you today.

 

Referencing on the information that you've shared I was now able to reproduce the issue that you're facing, please see attached screenshot. That being said, allow me to share this with the rest of the team to check further and someone from us will get back to you once we have our findings.

 

Regards,

Sherwin Diesta

testApp.png

Toby

unread,
Mar 4, 2020, 3:33:31 AM3/4/20
to Interactive Media Ads SDK
Any update on this issue? 

IMA SDK

unread,
Mar 4, 2020, 5:01:40 AM3/4/20
to to...@mychannels.com, ima...@googlegroups.com

Hi Toby,

 

Thank you for following up. The team is currently in a testing phase about this issue. However, let me follow up this with the team to get a feedback. We'll get back to you once we receive an update.

Orlando CR

unread,
May 28, 2021, 6:41:20 PM5/28/21
to Interactive Media Ads SDK
I had the same issue. It seems the messages need to be less than 50 characters, and contain only contain alphanumeric characters. Therefore, the example in Google's own docs lead to this exception: https://groups.google.com/g/ima-sdk/c/-0Sq2-n-_VA

IMA SDK

unread,
May 30, 2021, 11:35:24 PM5/30/21
to osm...@gmail.com, ima...@googlegroups.com

Hi there,

 

Thank you for reaching out to us with regards to your concern. Yes you are correct, there seems to be an undocumented check we are working to remove, but basically it requires all detailed reasons to be:

 - Less than 50 characters

 - Only include a-z, A-Z, 0-9, and . (periods)

 

Please find the workaround to resolved your case for now, until the fixed is publicly released. You may want to check our latest releases for an update.

Regards,

Google Logo
Michael Angelo Legaspi
IMA SDK Team
 


ref:_00D1U1174p._5001UXTQej:ref
Reply all
Reply to author
Forward
0 new messages