Android: Skipping video ad causes an ANR (Application not responding).

236 views
Skip to first unread message

Heikki Hautala

unread,
Jan 12, 2015, 1:49:09 AM1/12/15
to ima...@googlegroups.com
Hi!

I'm developing an Android application which uses IMA SDK beta 9. When a pre-roll ad is skipped, the ad video freezes, the actual video doesn't start and I get an ANR. If I wait until the ad is finished, the actual video will start playing right after the ad. If I change the app to use the Ad Tag from the sample app, the skipping works correctly. Also, this problem occurs in Mexico (which is the app's target country), but not here in Finland where i'm developing the app. Me (here in Finland) and my client (in Mexico) have both tested this on Asus Nexus 7 running Android 4.4.4. The problems occurs on my client's device but not on mine. This problem occurs on other devices too.

I can share our Ad Tag privately.

Any advice?

Regards,
Heikki Hautala


Shawn Busolits (IMA SDK Team)

unread,
Jan 12, 2015, 10:38:01 AM1/12/15
to ima...@googlegroups.com
Hi Heikki,

Can you send us the ad tag? You can share it privately by clicking the drop-down arrow at the top right of this post and selecting "Reply privately to author"

Thanks,
Shawn Busolits
IMA SDK Team

Bret McGowen

unread,
Jan 23, 2015, 7:48:12 PM1/23/15
to ima...@googlegroups.com
Hi Heikki,

This might be a tricky one to debug -- can you (and your client) see if the same behavior happens using your ad tag with our Basic Example Android Application? You can edit the ad tag URL in strings.xml. I just want to verify that it's a problem with the SDK and not some corner case in your video player app.

Thanks!
Bret McGowen
IMA SDK Team

Heikki Hautala

unread,
Jan 28, 2015, 3:24:21 AM1/28/15
to ima...@googlegroups.com
Hi Bret,

We have tested the basic example app with our ad tag, but in that test we also used our own content video URL. In that test the ad skipping worked. Would you like us to try the sample app with only ad tag changed?


Regards,
Heikki

Heikki Hautala

unread,
Jan 29, 2015, 1:59:21 AM1/29/15
to ima...@googlegroups.com
Hi Bret,

I think I found some kind of a solution.

Previously I had this problem with Android's VideoView: https://code.google.com/p/android/issues/detail?id=63346. I had implemented the suggested workaround by calling VideoView's seekTo(1) right after calling the start() method. When I removed the seekTo(1), the ad skipping started to work  ..in Mexico. I haven't been able to reproduce the bug here in Finland.

- Heikki

Bret McGowen

unread,
Feb 9, 2015, 6:07:03 PM2/9/15
to ima...@googlegroups.com
Hi Heikki,

Glad you were able to find a workaround; unfortunately I still wasn't able to reproduce the issue but I've opened an issue with the team and we make any discoveries I'll let you know. I'll also pass along your workaround in case it sheds any light on the problem.

Thanks,
Bret McGowen
IMA SDK Team

Heikki Hautala

unread,
Mar 27, 2015, 9:08:11 AM3/27/15
to ima...@googlegroups.com
Hi Bret,

Now we have this problem again. I get an ANR then the pre-roll ad finishes whether I skipped the ad or not. 

What makes this more mysterious, is that this only happens when the app is installed from Google Play (production or alpha release). If I install the app straight from the APK, everything works fine. This made me think that Google Play does some magic to the submitted APK, which causes the ANR. Then I extracted the Google Play installed APK from the device ( using "adb pull /data/app/<packagename>/") and installed the extracted APK back to the device, everything worked fine.

Could you give me any directions how to resolve this problem?

Regards,
Heikki Hautala

Heikki Hautala

unread,
Mar 27, 2015, 10:12:31 AM3/27/15
to ima...@googlegroups.com
After intensive debugging, we found out that the ANR is eventually caused by a 3rd party video analytics library. What remains mystery, is why this only happens with Google Play installs, but not with manual installs.

Regards, 
Heikki Hautala

Bret McGowen

unread,
Mar 31, 2015, 10:14:47 PM3/31/15
to ima...@googlegroups.com
Hi Heikki,

Can you let us know which analytics library? (You can private message me if you'd rather not post it publicly). Just so we can be aware internally for tracking and possible debugging.

Thanks,
Bret McGowen
IMA SDK Team

Yury Pavlotsky (IMA SDK Team)

unread,
Apr 2, 2015, 1:37:43 PM4/2/15
to ima...@googlegroups.com
Hi Heikki,

Thanks for sending us your info. Can you see if this issue persists with the 3.b10 release?

Thanks,
Yury Pavlotsky
IMA SDK Team

Heikki Hautala

unread,
Apr 8, 2015, 1:29:55 AM4/8/15
to ima...@googlegroups.com
Hi Yury,

The problem persists with the 3.b10 also. So I guess this concludes that the IMA SDK is not part of the issue. We are now trying an updated version of the analytics library and see if it helps.

Regards,
Heikki Hautala 

Veena

unread,
Nov 16, 2015, 12:02:00 AM11/16/15
to Interactive Media Ads SDK
Hello Heikki Hautala,

Did you find any solution to the issue you faced? I am also facing same issue and in my case it happens for manual installs as well. We are not using any video analytics library as well.

Please let me know if you were able get to root of the problem and found any solution for same.

Regards
Veena

Heikki Hautala

unread,
Nov 16, 2015, 1:25:15 AM11/16/15
to Interactive Media Ads SDK
Hi Veena,

We found the problem to be the ComScore analytics library. When the video was started, we sent an analytics call to ComScore. That call never returned for some reason, and because it was called in the UI thread, we got the ANR. Updating the library to the newest version fixed the problem. Since this happened only in Play installs, we used a rooted Android phone and altered its kernel to enable debugging mode globally. Then we installed the app from Google Play, and opened the video view. When the app stopped responding, we connected the phone to the debugger in Android Studio and hit the pause key and found out the culprit.

Because the ANR happens in manual installs in your case, I suggest that you run the application in debug mode, and when the application stops responding, hit the debugger's pause button and see what was the last line of your code that was run. I hope this helps =)

- Heikki

Veena

unread,
Nov 16, 2015, 1:58:35 AM11/16/15
to Interactive Media Ads SDK
Hey Heikki, 

Thanks so much for the response. Will try as suggested by you.

Regards
Veena
Reply all
Reply to author
Forward
0 new messages