Class cast exception in Google Mobile Ads

1,328 views
Skip to first unread message

byte...@gmail.com

unread,
Apr 18, 2018, 1:14:54 PM4/18/18
to Google Mobile Ads SDK Developers
Hello Google Mobile Ads team,

I am getting the following error / stacktrace in my App:

W/Ads: Failed
                                                                 java.lang.ClassCastException: com.google.ads.mediation.admob.AdMobAdapter cannot be cast to com.google.android.gms.ads.mediation.m
                                                                     at com.google.android.gms.ads.internal.mediation.client.y.a(:com.google.android.gms.dynamite_dynamitemodulesa@12529004@12.5.29 (000308-192802242):262)
                                                                     at com.google.android.gms.ads.internal.reward.c.b(:com.google.android.gms.dynamite_dynamitemodulesa@12529004@12.5.29 (000308-192802242):54)
                                                                     at com.google.android.gms.ads.internal.reward.client.e.onTransact(:com.google.android.gms.dynamite_dynamitemodulesa@12529004@12.5.29 (000308-192802242):57)
                                                                     at android.os.Binder.transact(Binder.java:361)
                                                                     at com.google.android.gms.internal.zzev.zzb(Unknown Source)
                                                                     at com.google.android.gms.internal.zzaez.zzc(Unknown Source)
                                                                     at com.google.android.gms.internal.zzafk.resume(Unknown Source)
                                                                     at com.byteghoul.grimdefender.GhoulAdsAndroid3.onResume(GhoulAdsAndroid3.java:411)
                                                                     at com.byteghoul.grimdefender.AndroidLauncher.onResume(AndroidLauncher.java:437)
                                                                     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1198)
                                                                     at android.app.Activity.performResume(Activity.java:5530)
                                                                     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3047)
                                                                     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3086)
                                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                     at android.os.Looper.loop(Looper.java:136)
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5586)
                                                                     at java.lang.reflect.Method.invokeNative(Native Method)
                                                                     at java.lang.reflect.Method.invoke(Method.java:515)
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
                                                                     at dalvik.system.NativeStart.main(Native Method)

I don't think that it is influencing the ads serving / ads performance - everything seems to work fine. The error is thrown when RewardedVideoAd.resume(activity) is called by the application's onResume() method. I tested this on both a Samsung Galaxy S5 and a Samsung Galaxy S7 with the same result. Further, I tested it with both the standalone mobile ads SDK and the mobile ads SDK with Firebase:

compile 'com.google.firebase:firebase-core:12.0.1'
compile 'com.google.firebase:firebase-ads:12.0.1'

and

compile 'com.google.android.gms:play-services-ads:12.0.1'

both with same result.

As already mentioned, I don't feel like it has any negative effects so far - but I am wondering why the error is thrown and how I can fix it.

Greetings,
Gerhard
BYTEGHOUL GAMES

mobileadssdk-a...@google.com

unread,
Apr 18, 2018, 4:41:58 PM4/18/18
to byte...@gmail.com, Google Mobile Ads SDK Developers
Hello, 

Thank you for contacting us. Is the issue reproducible with our sample apps? If so, can you share the detailed steps to reproduce the issue. If not, could you provide us a sample project along with the complete stack trace, so I can take a look. Please use Reply privately to author option to provide the details.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

byte...@gmail.com

unread,
Apr 19, 2018, 5:15:38 AM4/19/18
to Google Mobile Ads SDK Developers

Hello,

Yes, the issue is reproducible with the sample app! No additional steps necessary. I downloaded the RewardedVideoExample as well as the newest Android Studio version to do the test. I did not change any settings, build scripts or code.

-> Same issue (stacktrace thrown after call to onResume()), but everything working fine.



Greetings,
Gerhard
BYTEGHOUL GAMES

mobileadssdk-a...@google.com

unread,
Apr 19, 2018, 3:36:34 PM4/19/18
to byte...@gmail.com, Google Mobile Ads SDK Developers
Hello Gerhard, 

Thank you for sharing the details. I was able to replicate the issue you're noticing. I shared this information with the team. I will keep you posted if I have any new updates. 

Regards,
Bharani Cheurkuri
Mobile Ads SDK Team

Marcos Trujillo

unread,
Apr 24, 2018, 5:51:40 AM4/24/18
to Google Mobile Ads SDK Developers
Any update here or a possible solution?

mobileadssdk-a...@google.com

unread,
Apr 24, 2018, 11:32:29 AM4/24/18
to Marcos Trujillo, Google Mobile Ads SDK Developers
Hi Marcos, 

Thank you for the follow up. Our team is investigating the issue. I will keep you posted if I have any new information to share. 

Thanks,
Bharani Cherukuri
Mobile Ads SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/fa049392-16cc-4526-8c71-713fa244e57d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mobileadssdk-a...@google.com

unread,
Jun 4, 2018, 1:54:24 PM6/4/18
to Marcos Trujillo, Google Mobile Ads SDK Developers
Hello, 

This issue has been resolved. Currently, we do not have an ETA of when this fix will be available. Please keep an eye out on our release history page for more updates.

Thanks,
Bharani Cherukuri
Mobile Ads SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 04/24/18 05:51:40 marco...@gmail.com wrote:
--

Hà Anh

unread,
Aug 15, 2018, 2:15:22 AM8/15/18
to Google Mobile Ads SDK Developers
I got the same problem with error: java.lang.ClassCastException: com.google.ads.mediation.admob.AdMobAdapter cannot be cast to com.google.android.gms.ads.mediation.m
How can i slove this issue

Vào 00:54:24 UTC+7 Thứ Ba, ngày 05 tháng 6 năm 2018, mobileadssdk-a...@google.com đã viết:

mobileadssdk-a...@google.com

unread,
Aug 15, 2018, 3:20:57 PM8/15/18
to Hà Anh, Google Mobile Ads SDK Developers
Hello, 

It looks like you're having a different concern than the original issue on this thread. Feel free to open a new thread for any new issues. If you could elaborate the issue and share us the complete device logs, we will be able to take a look and assist you further.

Thanks,
Bharani Cherukuri
Mobile Ads SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages