Occasional crash when clicking ads

1,121 views
Skip to first unread message

Eric Young

unread,
Feb 7, 2017, 10:04:18 AM2/7/17
to Google Mobile Ads SDK Developers
Version of Android: 6.0.1 
Device: Nexus 7
Play Services Version: 10.0.1

Hello, we've been tracking down a crash in our app and have finally correlated it to clicking on banner ads. It is only occasional but the stack trace doesn't really give any insight into why this is happening. Any help or insight would be appreciated. Thank you.

Stack Trace: 

java.lang.RuntimeException: Window couldn't find content container view
                                                                      at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:3915)
                                                                      at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:3981)
                                                                      at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:1969)
                                                                      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3160)
                                                                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
                                                                      at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                      at android.os.Looper.loop(Looper.java:148)
                                                                      at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)


Chris Feldman (Mobile Ads SDK Team)

unread,
Feb 7, 2017, 11:28:55 AM2/7/17
to Google Mobile Ads SDK Developers
Hi Eric,

Are you able to replicate this crash in our sample app? If not, I'd suggest comparing your implementation to the sample's. If you are able to replicate this in our sample, please provide detailed steps for how to do so, along with Charles network logs, code snippets with your SDK implementation, and if possible, a link to your app.

If you continue to have issues, feel free to privately send a zip with your app's source code. I'd be happy to build your app and debug directly.

Regards,
Chris Feldman
Mobile Ads SDK Team

Eric Young

unread,
Feb 7, 2017, 1:36:33 PM2/7/17
to Google Mobile Ads SDK Developers
Hi Chris,

I am unable to replicate it in your sample app. But we also have a more complicated and honestly quite old implementation. Unfortunately I definitely can not send the entire codebase and especially can't post the code publicly. 

Chris Feldman (Mobile Ads SDK Team)

unread,
Feb 7, 2017, 2:43:36 PM2/7/17
to Google Mobile Ads SDK Developers
Hi Eric,

There is an option on the forum to send messages privately. I'd encourage you to send code snippets that way (adRequests, relevant layout files, etc). A Charles Network log from an instance of the crash would also be very helpful.

Let me know if you have any questions.

Regards,
Chris Feldman
Mobile Ads SDK Team

Eric Young

unread,
Feb 7, 2017, 5:18:37 PM2/7/17
to Google Mobile Ads SDK Developers
Okay this may be a silly question but I don't see any way to send messages privately on this except for maybe "Contact Owner" under "About" is that what I am looking for?

Chris Feldman (Mobile Ads SDK Team)

unread,
Feb 8, 2017, 9:53:57 AM2/8/17
to Google Mobile Ads SDK Developers
Hi Eric,

There should be a drop-down menu in the top right hand corner of each post. In that drop-down, there is an option to "Reply privately to author."

I've attached a screenshot. Let me know if you continue to have issues.

Regards,
Chris Feldman
IMA SDK Team
Screen Shot 2017-02-08 at 9.34.39 AM.png

Eric Young

unread,
Feb 8, 2017, 10:21:40 AM2/8/17
to Google Mobile Ads SDK Developers
Hi Chris,

I am definitely not seeing that.

Thanks,

Eric Young

unread,
Feb 8, 2017, 10:28:47 AM2/8/17
to Google Mobile Ads SDK Developers
Screen Shot 2017-02-08 at 8.19.54 AM.png

Chris Feldman (Mobile Ads SDK Team)

unread,
Feb 8, 2017, 3:11:34 PM2/8/17
to Google Mobile Ads SDK Developers
Hi Eric,

I can't explain why you're not seeing the option to reply privately. I've sent you an email to which you can respond.

Regards,
Chris Feldman
Mobile Ads SDK Team

Iancu FlorinRadu

unread,
Mar 2, 2017, 7:00:29 AM3/2/17
to Google Mobile Ads SDK Developers
Any update on this problem?

Chris Feldman (Mobile Ads SDK Team)

unread,
Mar 2, 2017, 10:08:38 AM3/2/17
to Google Mobile Ads SDK Developers
(11 mins ago)9:57 am

mobileads-sdk-support mobileads-...@google.com

to google-adm...@googlegroups.com
Hello,

Our team still needs more information in order to replicate and diagnose the issue. If you're able to recreate your crash in one of our sample apps, please provide us with detailed steps for how to do so and we can continue to investigate.

Regards,
Chris Feldman
Mobile Ads SDK Team

On Thursday, March 2, 2017 at 7:00:29 AM UTC-5, Iancu FlorinRadu wrote:
Any update on this problem?
Auto Generated Inline Image 1
Auto Generated Inline Image 2
Auto Generated Inline Image 3

subhash pandey

unread,
Mar 30, 2017, 1:46:04 AM3/30/17
to Google Mobile Ads SDK Developers
Hi,
I am facing same issue when ad is clicked and our app goes in background it crashed with same as above log.

Attached is code snippet of  method responsible for displaying ad in a list inside DrawerLayout list .

On Thursday, March 2, 2017 at 8:38:38 PM UTC+5:30, Chris Feldman (Mobile Ads SDK Team) wrote:
Hello,

Our team still needs more information in order to replicate and diagnose the issue. If you're able to recreate your crash in one of our sample apps, please provide us with detailed steps for how to do so and we can continue to investigate.

Regards,
Chris Feldman
Mobile Ads SDK Team
ad_display_code_snippet.txt
Message has been deleted

amar khatri

unread,
Apr 14, 2017, 6:34:24 AM4/14/17
to Google Mobile Ads SDK Developers
Hi Chris,

The exactly same issue I found in my app when I click on any ads (banner/ native ) application crash, following the crash logs that I received


InjectionManager: dispatchOnViewCreated > Target : com.google.android.gms.ads.AdActivity isFragment :false
W/Ads: The webview does not exist. Ignoring action.
AndroidRuntime: Shutting down VM
AndroidRuntime: FATAL EXCEPTION: main
                                                                                  
                                                                                  java.lang.RuntimeException: Window couldn't find content container view
                                                                                      at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:4614)
                                                                                      at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:4683)
                                                                                      at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2263)
                                                                                      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4276)
                                                                                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3361)
                                                                                      at android.app.ActivityThread.access$1100(ActivityThread.java:222)
                                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                      at android.os.Looper.loop(Looper.java:158)
                                                                                      at android.app.ActivityThread.main(ActivityThread.java:7229)
                                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)




The crash is 100% in  Android marshmellow (Samsung S6), but in your sample app I'm unable to find any crash like this. Kindly Solve this issue ASAP.

Thanks & Regards,
Amar Khatri.

Shankar Prasad

unread,
Apr 14, 2017, 6:46:44 AM4/14/17
to Google Mobile Ads SDK Developers
I am also getting the same crash on marshmallow although my code and the sample code are similar, but the sample code is running well.

java.lang.RuntimeException: Window couldn't find content container view

Please update!
Shankar

Anil Adhikari

unread,
Apr 14, 2017, 6:48:24 AM4/14/17
to Google Mobile Ads SDK Developers
Bummer, same issue is also happening with me. Is this really so prominent issue.  Doesn't seem to have any workaround of this crash.

@Chris Feldman

Please get this issue checked and give us a work around.

This is almost 100 % crash. Crash log is below.

    java.lang.RuntimeException: Window couldn't find content container view
                                                                                      at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:414)
                                                                                      at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:383)
                                                                                      at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:263)



-Anil Singh

 

On Friday, April 14, 2017 at 4:04:24 PM UTC+5:30, amar khatri wrote:

Jaideep Nagra

unread,
Apr 14, 2017, 6:52:47 AM4/14/17
to Google Mobile Ads SDK Developers
We are also facing the same crash in our project. Have checked and matched all the implementation with sample but still facing the same issue.

Please look at this issue.

On Friday, April 14, 2017 at 4:04:24 PM UTC+5:30, amar khatri wrote:

Chris Feldman (Mobile Ads SDK Team)

unread,
Apr 14, 2017, 3:22:12 PM4/14/17
to Google Mobile Ads SDK Developers
Hi All,

In order to investigate the issue, we need to be able to reproduce this crash on our end. Is anyone seeing the same behavior in our sample apps? If so, please provide detailed steps for how to reproduce the crash, including any code changes you made, and your crash logs. A Charles network log would also be very helpful.

If no one is able to reproduce the crash in our sample app, then you can create a zipped sample of your own app. Again, we'll need your crash logs, along with detailed steps for how to reproduce the crash, and a Charles network log.

Regards,
Chris Feldman
Mobile Ads SDK Team


amar khatri

unread,
Apr 19, 2017, 1:18:38 AM4/19/17
to Google Mobile Ads SDK Developers
Hi Chris,

I found the reason of app crash, this is due to the external library viz ComScore  version 5.x that I recently updated in my app and also I implement the same library in your sample app and unfortunately your app is crashing on click on any ad (banner, native) and the log is same as my app.

Regards,
Amar Khatri. 

浩然

unread,
May 23, 2017, 10:10:57 AM5/23/17
to Google Mobile Ads SDK Developers
Same issue here. 
Almost different kind of devices can generate this issue:

=> Click the PublihserAdview =>  app crash
=> Error Log: Window couldn't find content container view.

Sorry, I have no idea how to regenerate this issue. 


Some device error log here:
LGE devices:
Android OS: 6.0 /6.0.1
 
Non-fatal Exception: java.lang.RuntimeException: Window couldn't find content container view
       at com.android.internal.policy.PhoneWindow.generateLayout_aroundBody2(PhoneWindow.java:3998)
       at com.android.internal.policy.PhoneWindow$AjcClosure3.run(PhoneWindow.java:1)
       at android.view.PhoneWindowAO.ajc$around$android_view_PhoneWindowAO$3$73b7c3d1proceed(PhoneWindowAO.aj:48)
       at android.view.PhoneWindowAO.ajc$around$android_view_PhoneWindowAO$3$73b7c3d1(PhoneWindowAO.aj:49)
  


 Samsung Device:
Fatal Exception: java.lang.RuntimeException: Window couldn't find content container view
       at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:4619)
       at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:4688)
      

Chris Feldman (Mobile Ads SDK Team)

unread,
May 23, 2017, 11:09:07 AM5/23/17
to Google Mobile Ads SDK Developers
Hi,

Are you able to reproduce this issue in any of our sample apps? The DoubleClick BannerExample uses a PublisherAdView. If you are able to reproduce the issue, please open a new thread with detailed steps for how to replicate the behavior. If possible, include your Ad Unit ID, as well as information about your testing environment, and step by step instructions.

Based on the history of this thread, it's likely that this is being caused by another external dependency that your app is using. I'd suggest trying to rule that out by removing any recently adding dependencies and testing whether or not you still see the crash.

Let me know if you continue to have issues.

Regards,
Chris Feldman
Mobile Ads SDK Team

Michael Pearce

unread,
Jun 1, 2017, 11:05:40 PM6/1/17
to Google Mobile Ads SDK Developers
Just chiming in on this thread.

I saw the exact same issue, and also narrowed it down to the Comscore analytics SDK as some others have. Specifically, I had the problem with version 5.2.0 of that library, but upgrading to 5.3.1 seems to have fixed it.

-Michael
Reply all
Reply to author
Forward
0 new messages