App crashes when InterstitialAd is loaded

303 views
Skip to first unread message

swifter

unread,
Aug 19, 2021, 6:48:11 PM8/19/21
to Google Mobile Ads SDK Developers
I use Unity Native ads- and using  native ads build of the Google Mobile Ads.
When installing Unity Ads- mediation the app crashes!!!
The only way to fix it is to change the gradle file   implementation 'com.google.ads.mediation:unity:3.7.2.0'
From 3.7.2.0 to 3.6.0.0  so it can support the old Google Mobile Ads sdk.
The native ads SDK installs play-services-ads:19.5.0 which is old and doesn't support new SDKS!!!
  (  implementation 'com.google.android.gms:play-services-ads:19.5.0')

The problem seems to be caused by play-services-ads version 20, which moves the InterstitialAd class to the namespace "com.google.android.gms.ads.interstitial" (previously it was in namespace "com.google.android.gms.ads").

What should I do?????

Mobile Ads SDK Forum Advisor

unread,
Aug 20, 2021, 3:47:33 AM8/20/21
to shlig...@gmail.com, google-adm...@googlegroups.com
Hi Shai,

Thank you for raising this to us.

Could you please provide the details below (via Reply to author option. If the option does not work, kindly reply to mobileadstesting99@gmail.com, then let us know here once sent) so that I can further investigate this issue:
  • App ID
  • Ad Unit ID
  • Sample project where the issue is reproducible
  • Screen recording
Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 

 

ref:_00D1U1174p._5004Q2LolMe:ref

swifter

unread,
Aug 20, 2021, 1:00:11 PM8/20/21
to Google Mobile Ads SDK Developers
Thank you, you don't need app id or ad unit ID, as this is simply an issue with your SDK and the namespace change.
It's because play-services-ads:19.5.0 doesn't work with   'com.google.ads.mediation:unity:3.7.2.0', 
If you have these on your gradle file you'll also have an error when loading InterstitialAd :
    implementation 'com.google.android.gms:play-services-ads:19.5.0' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7
    implementation 'com.google.ads.mediation:unity:3.7.2.0' // Assets/GoogleMobileAds/Editor/UnityMediationDependencies.xml:8

Error-
Error AndroidRuntime java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd;
Error AndroidRuntime Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.InterstitialAd" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar",

On Friday, August 20, 2021 at 12:47:33 AM UTC-7 mobileadssdk wrote:
Hi Shai,

Thank you for raising this to us.

Could you please provide the details below (via Reply to author option. If the option does not work, kindly reply to mobileads...@gmail.com, then let us know here once sent) so that I can further investigate this issue:

Mobile Ads SDK Forum Advisor

unread,
Aug 20, 2021, 2:04:44 PM8/20/21
to shlig...@gmail.com, google-adm...@googlegroups.com
Hi Swifter,

Thank you for responding back. We would ask if you can send us a simple sample app with your implementation of the SDK so that we can look at it and test it. As well as the steps that you are seeing that are causing the issue. We do ask for the App id and Ad Unit id so as to make sure that we are working on the environment and under the same conditions as you are. Also if you have Charles logs of the crash this can also help us. At the same time we also ask if you have tested with our sample app?

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2LolMe:ref

swifter

unread,
Aug 20, 2021, 3:36:30 PM8/20/21
to Google Mobile Ads SDK Developers
Your sample app tests Google Mobile Ads SDK,  but I don't use it, I use- the native ads build (https://dl.google.com/googleadmobadssdk/GoogleMobileAds-native.unitypackage)
If you install the native ads build it will add     implementation 'com.google.android.gms:play-services-ads:19.5.0' which is OLD and doesn't support new mediation SDKs
The error says-  Didn't find class "com.google.android.gms.ads.InterstitialAd" on path: DexPathList
and it happens because you changed the class name
It's because play-services-ads:19.5.0 doesn't work with   'com.google.ads.mediation:unity:3.7.2.0', 
If you have these on your gradle file you'll also have an error when loading InterstitialAd :
    implementation 'com.google.android.gms:play-services-ads:19.5.0' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7
    implementation 'com.google.ads.mediation:unity:3.7.2.0' // Assets/GoogleMobileAds/Editor/UnityMediationDependencies.xml:8

Here is the crash log-
Error AndroidRuntime FATAL EXCEPTION: main Error AndroidRuntime java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/ads/InterstitialAd; Error AndroidRuntime at com.google.unity.ads.Interstitial$1.run(Interstitial.java:69) Error AndroidRuntime at android.os.Handler.handleCallback(Handler.java:873) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:99) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.os.Looper.loop(Looper.java:214) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.ActivityThread.main(ActivityThread.java:7073) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at java.lang.reflect.Method.invoke(Native Method) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.InterstitialAd" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file cFgPBRjZOA6VSPmpMc_bvQ==/split_config.arm64_v8a.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]] 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at java.lang.ClassLoader.loadClass(ClassLoader.java:379) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime ... 8 more 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime Suppressed: java.io.IOException: No original dex files found for dex location (arm64) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.DexFile.openDexFileNative(Native Method) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.DexFile.openDexFile(DexFile.java:354) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.DexFile.<init>(DexFile.java:101) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.DexFile.<init>(DexFile.java:75) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.DexPathList.<init>(DexPathList.java:164) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:764) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.LoadedApk.getClassLoader(LoadedApk.java:847) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.LoadedApk.getResources(LoadedApk.java:1088) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.ContextImpl.createAppContext(ContextImpl.java:2563) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6123) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.ActivityThread.access$1200(ActivityThread.java:238) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1787) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:106) 2021/08/20 09:34:23.975 24258 24258 Error AndroidRuntime ... 5 more

Mobile Ads SDK Forum Advisor

unread,
Aug 23, 2021, 3:36:42 AM8/23/21
to shlig...@gmail.com, google-adm...@googlegroups.com
Hi Shai,

Thank you for getting back to us. I've raised this to the rest of the team for further investigation. We'll update this thread the soonest we have our findings.

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2LolMe:ref

swifter

unread,
Aug 23, 2021, 3:58:01 PM8/23/21
to Google Mobile Ads SDK Developers
Do you know how long will it take?  Because I had another issue before, and you also wrote "further investigation" and no one ever contacted me again...

Mobile Ads SDK Forum Advisor

unread,
Aug 24, 2021, 3:04:16 AM8/24/21
to shlig...@gmail.com, google-adm...@googlegroups.com

Hello Swifter,

Thank you for reaching out to us.

We cannot provide a definite timeline on when the fix will be release. However, rest assured that the team is actively working on such. In the meantime, kindly keep an eye on our release notes for updates regarding this.

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2LolMe:ref

swifter

unread,
Aug 24, 2021, 2:40:10 PM8/24/21
to Google Mobile Ads SDK Developers
The release notes to sent are not for Mobile-Ads-Native-Unity.... that's the problem. I don't even know which version I have. Where are the release notes for the native version??

everyone Рит

unread,
Aug 27, 2021, 5:57:56 PM8/27/21
to swifter, Google Mobile Ads SDK Developers
Hi 👋 Now a separate stage of the update resource is available, see the github on an example,
 @AfirstS

пт, 20 авг. 2021 г., 1:48 swifter <shlig...@gmail.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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/c0d1231c-8487-48e5-8ab3-e3da91796902n%40googlegroups.com.

Mobile Ads SDK Forum Advisor

unread,
Aug 30, 2021, 11:10:36 AM8/30/21
to rits...@gmail.com, google-adm...@googlegroups.com, shlig...@gmail.com
Hi Everyone,

Thank you for the response back to us. Can you give us some more context as well as which github link you are referring to? You are saying now a separate stage of the update resource is available? But not giving any information about what you mean by this? If we can get some more information concerning this we will be happy to look more into it.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2LolMe:ref

Mobile Ads SDK Forum Advisor

unread,
Jun 16, 2022, 7:45:31 AM6/16/22
to shlig...@gmail.com, google-adm...@googlegroups.com
Hello everyone,

I hope you're doing fine and safe.

I just want to circle back on this and let you know that the reported issue here has been fixed. Let us know if you still encounter the issue, so I could raise it to the team once again.

Regards,
Google Logo
Teejay Wennie
Mobile Ads SDK Team
 


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