VerifyError in older API emulator on startup

860 views
Skip to first unread message

DS

unread,
Dec 9, 2022, 3:19:21 PM12/9/22
to Google Mobile Ads SDK Developers

Insta-crash at startup right after splash screen in any older API emulator in Android Studio up to and including API 19, whether running debug or release.  The crash looks like this:

E FATAL EXCEPTION: Thread-127 java.lang.VerifyError: com/google/android/gms/dynamite/DynamiteModule at
    com.google.android.gms.internal.ads.zzcjd.zzc(com.google.android.gms:play-services-ads-lite@@20.6.0:1) at
    com.google.android.gms.internal.ads.zzcjd.zzb(com.google.android.gms:play-services-ads-lite@@20.6.0:1) at
    com.google.android.gms.internal.ads.zzbwz.run(com.google.android.gms:play-services-ads-lite@@20.6.0:11) at java.lang.Thread.run(Thread.java:856)

Note the bug seems related to play-services-ads-lite, even when using full play-services-ads. More details:

Android Studio Flamingo | 2022.2.1 Canary 9 Runtime version: 17.0.4.1+0-17.0.4.1b469.62-9127311 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.19.0-26-generic Registry: external.system.auto.import.disabled=true ide.text.editor.with.preview.show.floating.toolbar=false gradle.version.catalogs.dynamic.support=true dependencies { classpath("com.android.tools.build:gradle:8.0.0-alpha09") classpath(kotlin("gradle-plugin", version = "1.8.0-RC"))

from build.gradle

     implementation("com.google.android.play:app-update-ktx:2.0.1")
     implementation("com.google.android.gms:play-services-ads:20.6.0")

Note I am not yet using newest play-services-ads beyond 20.6.0 as it doesn't support older APIs, and the app offers support back to API 16.   However a test with the latest 21.3.0 or whatever also crashes.

Using gradle 7.6 though also tried the 8.0 betas.

Tried:

  • changing jvmTarget, sourceCompatibility and targetCompatibility = everything from 1.7 to 11 to JavaVersion.VERSION_17
  • various versions of play-services-ads and play-services-ads-lite.
  • clearing project and caches.
  • Playing with proguard config and eliminating it entirely- but I don't think this is the issue at all as debug builds crash which do not use R8.

This error may not affect actual devices or it may-- I do not have an actual older device to test with so rely on the emulator.  But if is the emulator images, perhaps play-services needs to be updated ?  Examples:

API 16 emulator image-- includes play services version 9.2.56

API 19 emulator image-- includes play services 20.24.14

The emulators are also reporting missing classes like:

E  Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.wrappers.PackageManagerWrapper.zza

and

E Could not find class 'android.os.UserManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtilLight.isRestrictedUserProfile

But AFAICT this is not causing a crash like the VerifyError is.

Thanks!

DS

unread,
Dec 9, 2022, 3:59:38 PM12/9/22
to Google Mobile Ads SDK Developers
Addendum:

Since this issue seems to be related to DynamiteModule, which appears to be part of play-services-basement, I tried using an older version than current (18.1.0):

implementation("com.google.android.gms:play-services-basement:18.0.1")

This still crashed, but differently.  Here's a snippet of what went wrong on API 16 emulator:

W  VFY: unable to find class referenced in signature (Landroid/content/pm/PackageInstaller;)
W  VFY: unable to resolve check-cast 136 (Landroid/content/pm/PackageInstaller$SessionInfo;) in Lcom/google/android/gms/common/GooglePlayServicesUtilLight;
D  VFY: replacing opcode 0x1f at 0x0028
D  GC_CONCURRENT freed 307K, 4% free 11527K/11911K, paused 10ms+11ms, total 23ms
W  VFY: unable to find class referenced in signature (Ldalvik/system/DelegateLastClassLoader;)
W  VFY: Ljava/lang/Object; is not instance of Ljava/lang/ClassLoader;
W  VFY: bad arg 0 (into Ljava/lang/ClassLoader;)
W  VFY:  rejecting call to Lcom/google/android/gms/dynamite/DynamiteModule;.zzd (Ljava/lang/ClassLoader;)V
W  VFY:  rejecting opcode 0x71 at 0x0094
W  VFY:  rejected Lcom/google/android/gms/dynamite/DynamiteModule;.zza (Landroid/content/Context;Ljava/lang/String;Z)I
W  Verifier rejected class Lcom/google/android/gms/dynamite/DynamiteModule;
W  threadid=10: thread exiting with uncaught exception (group=0x9e6c4228)
W  threadid=11: thread exiting with uncaught exception (group=0x9e6c4228)
I  Rejecting re-init on previously-failed class Lcom/google/android/gms/dynamite/DynamiteModule; v=0x9e6b9b18
W  threadid=11: thread exiting with uncaught exception (group=0x9e6c4228)
W  Force removing ActivityRecord{9f2f5128 com.app.app}: app died, no saved state

the process ended here-- no explicit VerifyError tho.  Again, this is with:

implementation("com.google.android.play:app-update-ktx:2.0.1")
implementation("com.google.android.gms:play-services-ads:20.6.0")
implementation("com.google.android.gms:play-services-basement:18.0.1")

Going back to older versions of basement than this (which had vulnerabilities to CVE-2022-2390) also crashed.

Cheers!

Mobile Ads SDK Forum Advisor

unread,
Dec 12, 2022, 1:04:39 PM12/12/22
to dubs...@gmail.com, google-adm...@googlegroups.com
Hi DS,

Thank you for raising this to us. Please do note that the minimum API version for the Mobile Ads SDK to work is 19 as per our prerequisites. I went ahead tried to reproduce the reported issue using our banner sample app. As per testing, I wasn't able to reproduce the issue. Instead, the app works fine (please see attached screenshot). I'm using Google Pixel 4 API 19 for my testing. With that, could you please try our sample app on your end, then let me know if you still able to encounter the crash? If so, could you please provide a screen recording capturing the issue?

Regards,
Google Logo
Teejay Wennie
Mobile Ads SDK Team
 
 

ref:_00D1U1174p._5004Q2h1OsN:ref
Screenshot 2022-12-13 at 1.40.57 AM.png

DS

unread,
Dec 12, 2022, 9:18:49 PM12/12/22
to Google Mobile Ads SDK Developers
Hello!

Yes, I was able to reproduce the crash using the Kotlin banner sample app, building on Android Studio Flamingo Canary 9.  I had to modify the build environment slightly to get it to build on AS FC 9-- multidex was necessary, for example.  I also updated a few libraries/plugins to what you would find on an up-to-date app.  I am using a modern gradle 7.6 too.

As I explained, I have a minSdkVersion 16 and use the 20.6.3 version of the library to continue supporting them, though the crash still occurs in the API 19 emulator.

I am attaching a .diff so you can reproduce yourself.

To reproduce:

*  Start with Kotlin Banner example app as per your suggestion.
*  Use Android Studio Flamingo Canary 9 and
*  Apply the attached crash.diff -- this will reproduce my build scenario.
*  Create an emulator <= 19 with Google APIs.  (Even API 19 will crash)
*  Build/Run in the emulator.
*  Watch the crash:

2022-12-13 02:04:53.069  9597-9597  dalvikvm                com...oid.gms.example.bannerexample  W  VFY: unable to resolve check-cast 38 (Landroid/app/ApplicationExitInfo;) in Landroidx/work/impl/utils/ForceStopRunnable;
2022-12-13 02:04:53.069  9597-9597  dalvikvm                com...oid.gms.example.bannerexample  D  VFY: replacing opcode 0x1f at 0x0041
2022-12-13 02:04:53.079  9597-9619  dalvikvm                com...oid.gms.example.bannerexample  W  VFY: unable to find class referenced in signature (Ldalvik/system/DelegateLastClassLoader;)
2022-12-13 02:04:53.079  9597-9619  dalvikvm                com...oid.gms.example.bannerexample  W  VFY: Ljava/lang/Object; is not instance of Ljava/lang/ClassLoader;
2022-12-13 02:04:53.079  9597-9619  dalvikvm                com...oid.gms.example.bannerexample  W  VFY: bad arg 0 (into Ljava/lang/ClassLoader;)
2022-12-13 02:04:53.079  9597-9619  dalvikvm                com...oid.gms.example.bannerexample  W  VFY:  rejecting call to Lcom/google/android/gms/dynamite/DynamiteModule;.zze (Ljava/lang/ClassLoader;)V
2022-12-13 02:04:53.079  9597-9619  dalvikvm                com...oid.gms.example.bannerexample  W  VFY:  rejecting opcode 0x71 at 0x008d
2022-12-13 02:04:53.079  9597-9619  dalvikvm                com...oid.gms.example.bannerexample  W  VFY:  rejected Lcom/google/android/gms/dynamite/DynamiteModule;.zza (Landroid/content/Context;Ljava/lang/String;Z)I
2022-12-13 02:04:53.079  9597-9619  dalvikvm                com...oid.gms.example.bannerexample  W  Verifier rejected class Lcom/google/android/gms/dynamite/DynamiteModule;
2022-12-13 02:04:53.079  9597-9619  dalvikvm                com...oid.gms.example.bannerexample  W  threadid=12: thread exiting with uncaught exception (group=0x9cd85b20)
2022-12-13 02:04:53.079  9597-9597  dalvikvm                com...oid.gms.example.bannerexample  I  Could not find method androidx.core.app.ComponentActivity.onRequestPermissionsResult, referenced from method androidx.activity.ComponentActivity.onRequestPermissionsResult
2022-12-13 02:04:53.079  9597-9597  dalvikvm                com...oid.gms.example.bannerexample  W  VFY: unable to resolve virtual method 12631: Landroidx/core/app/ComponentActivity;.onRequestPermissionsResult (I[Ljava/lang/String;[I)V
2022-12-13 02:04:53.079  9597-9597  dalvikvm                com...oid.gms.example.bannerexample  D  VFY: replacing opcode 0x6f at 0x0020
2022-12-13 02:04:53.079  9597-9622  dalvikvm                com...oid.gms.example.bannerexample  I  Rejecting re-init on previously-failed class Lcom/google/android/gms/dynamite/DynamiteModule; v=0x9cd79be8
---------------------------- PROCESS ENDED (9597) for package com.google.android.gms.example.bannerexample ----------------------------
2022-12-13 02:04:53.079  9597-9622  dalvikvm                com...oid.gms.example.bannerexample  W  threadid=13: thread exiting with uncaught exception (group=0x9cd85b20)
2022-12-13 02:04:53.079  9597-9622  Process                 com...oid.gms.example.bannerexample  I  Sending signal. PID: 9597 SIG: 9
2022-12-13 02:04:53.079  9597-9619  AndroidRuntime          com...oid.gms.example.bannerexample  E  FATAL EXCEPTION: Thread-164
                                                                                                    Process: com.google.android.gms.example.bannerexample, PID: 9597

                                                                                                    java.lang.VerifyError: com/google/android/gms/dynamite/DynamiteModule
                                                                                                        at com.google.android.gms.internal.ads.zzcjd.zzc(com.google.android.gms:play-services-ads-lite@@20.6.0:1)
                                                                                                        at com.google.android.gms.internal.ads.zzcjd.zzb(com.google.android.gms:play-services-ads-lite@@20.6.0:1)
                                                                                                        at com.google.android.gms.internal.ads.zzbwz.run(com.google.android.gms:play-services-ads-lite@@20.6.0:11)
                                                                                                        at java.lang.Thread.run(Thread.java:841)

I won't bother attaching a video of an app starting up and then immediately crashing unless you really need it.
Thanks!
crash.diff

Mobile Ads SDK Forum Advisor

unread,
Dec 13, 2022, 3:23:39 AM12/13/22
to dubs...@gmail.com, google-adm...@googlegroups.com

Hello DS,

 

Michael here and I work along with Teejay.

 

From your last response I can see that you are still setting the minSdkVersion to 16, would you be able to try and update it to minSdkVersion 19 and see if you will still see the issue? Additionally, can you confirm if you are only encountering this using Android Studio Flamingo Canary 9?

 

Regards,

Google Logo
Michael Angelo
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2h1OsN:ref

DS

unread,
Dec 13, 2022, 7:39:11 PM12/13/22
to Google Mobile Ads SDK Developers
Hey there Michael!

So let me answer your last question first-- I only noticed the issue with AS Flamingo Canary 9, and didn't really check before say Canary 7 or so, so the issue must have occurred in the past two months-ish

To answer your other questions:

*  Modifying the above crash.diff to use minSdkVersion 19 still crashed on API 19 emulator.  Similar error to above ( java.lang.VerifyError: com/google/android/gms/dynamite/DynamiteModule)
*  Next I modified build.gradle to use the current  'com.google.android.gms:play-services-ads:21.3.0', synced, and re-ran.  This is the latest release of play-services-ads, and running on API 19, so I would expect it to run fine.  Instead I got the error again.
*  Ran 21.3.0 on API 24 emulator.  Crashed!
*  Ran 21.3.0 on API 26 emulator.  Crashed!
*  Ran 21.3.0 on API 33 emulator.  Crashed!!!!!
*  AS also gave me a notice:  "Component:  Google APIs Intel x86 Atom_64 System Image" has been updated (That is, API 33 image version 7 --> 8).  Updating and re-running did nothing to fix the issue.
*  So I ran 21.3.0 on new API 33 emulator (version 8).  Crashed!
*  Tried backing up to  compileSdkVersion 32.  Crashed.
*  Couldn't try an older Android Gradle plugin as it wouldn't let me go earlier than 8.0-a9 on Canary 9
*  I'd previously tried older Kotlin without effect.
*  Reverted back to original constraint-layout:1.0.2 and androidx.appcompat:appcompat:1.2.0 from the demo source-- crash.   That wasn't it.
*  Crashed on a real API 33 pixel phone (though it does install properly, shows up in the app list, etc.)

I kept trying various configurations, but every time the error is the same VerifyError.  This is very strange as I haven't even see that before in API 33 even in my own app testing.  (Just re-checked.  Runs in API 33 emulator in another app without issue).  Still, I'd rather see it it crash at higher API levels in your demo app so you can perhaps figure out what's going on.)

As mentioned previously, can try reproducing on AS Canary 9 on Linux with the crash.diff I sent earlier-- it has very few changes from the demo app-- just enough to bring it up to date and make it build.  I have no idea what's wrong here.  FWIW I am also running AS in a container, but the fact it was working previously and that other apps work fine suggests that this isn't related.  Even if it is the problem, AS/ads-sdk shouldn't crash apps when from a container (as in ChromeOS devices).

Thanks and I hope this is helpful.  Should another AS canary 10 come out, I'll try it and report back.

Mobile Ads SDK Forum Advisor

unread,
Dec 14, 2022, 2:40:19 AM12/14/22
to dubs...@gmail.com, google-adm...@googlegroups.com

Hi DS,

 

Thank you for your response.

 

I've tried to modify our sample app for kotlin banner, and applied the configurations that you've added on the file you've provided previously. I was able to apply all the configuration, and when I've tested it, I was able to encounter the crash. However, on the logcat, the crash log that I've encounter is different to the crash logs you provided. But, let me share this to the wider team to further investigate the crashes with this configuration. Rest assured that one of our team will reach out to you.

 

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2h1OsN:ref

DS

unread,
Dec 14, 2022, 3:14:43 AM12/14/22
to Google Mobile Ads SDK Developers
Thanks for getting back to me.  Reassured to hear you were able to recreate "a", if not "the", crash.  At least I'm not crazy :)  I can't imagine why it appears different than the VerifyError I experienced, but at least the team has something to go with now.  Please let me know if/how I may be of further help!

Mobile Ads SDK Forum Advisor

unread,
Dec 15, 2022, 3:34:40 AM12/15/22
to dubs...@gmail.com, google-adm...@googlegroups.com
Hello DS,

Thanks for reaching out.

The VerifyError here doesn't seem to be related to the Google Mobile Ads SDK, can you provide the stack trace from all threads so we can investigate further?


Regards,
Joshua

ref:_00D1U1174p._5004Q2h1OsN:ref

DS

unread,
Dec 16, 2022, 4:48:43 PM12/16/22
to Google Mobile Ads SDK Developers
Attached is a logcat of the VerifyError crash in the BannerExample app from beginning to end that I grabbed a few days ago.

Strangely, when I now updated the play-services-ads library to the just-released 21.4.0 version, the app still crashed right at startup, but the error changed to:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.google.android.gms.example.bannerexample/com.google.android.gms.example.bannerexample.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
     at android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:109)
     at com.google.android.gms.example.bannerexample.MainActivity.<init>(MainActivity.kt:12)

                                                                                                   
That's abbreviated for space, but you can see the basic issue.

What's even stranger is that when I revert back to 20.6.0, instead of the VerifyError I now also get the above error!  However, when I switched to a different app to test 20.6.0 (and 21.4.0) again, the VerifyError is still there, and it appears similar to the log below.  So not sure what's going on at all.

Hope this is helpful.
crash.txt

Mobile Ads SDK Forum Advisor

unread,
Dec 16, 2022, 5:33:21 PM12/16/22
to dubs...@gmail.com, google-adm...@googlegroups.com
Hello DS,

Thanks for the information provided.

We are currently looking into it and will get back to you as soon as there is an update.

DS

unread,
Jan 7, 2023, 4:55:16 PM1/7/23
to Google Mobile Ads SDK Developers
Happy new year!

Playing with this a little bit more, I found something interesting:
  • As we know from the logs, the VerifyError is connected to something about DynamiteModule.
  • Noticed a warning with not finding Trace.isEnabled() that preceded the crash.  Got me thinking about new things introduced around this period...
  • So I went to the API 19 emulator and confirmed everything is still crashing as documented previously.
  • Then under Settings->Developer Options->Select Runtime, I switched from Use Dalvik to Use ART.
  • Rebooted.  Now app runs in API 19!
  • HOWEVER, as soon as the app started, the **Play Store** crashed w/signal 11!  After crashing, running Play Games (which was on the emulator) rebooted the whole emulator!
Like the Dalvik crash, the play store crash also references: DynamiteModule:

2023-01-07 13:08:13.834  3160-3160 
2023-01-07 13:08:13.834  3160-3160  DynamiteModule          com.google.android.gms               W  Local module descriptor class for providerinstaller not found.
2023-01-07 13:08:13.844  3160-3160  ProviderHelper          com.google.android.gms               W  Unknown dynamite feature providerinstaller
2023-01-07 13:08:13.854  3160-3160  DynamiteModule          com.google.android.gms               I  Considering local module providerinstaller:0 and remote module providerinstaller:0DynamiteModule          com.google.android.gms               W  Local module descriptor class for providerinstaller not found.
2023-01-07 13:08:14.054  3160-3176  DynamiteModule          com.google.android.gms               I  Considering local module com.google.android.gms.googlecertificates:4 and remote module com.google.android.gms.googlecertificates:4
2023-01-07 13:08:14.054  3160-3176  DynamiteModule          com.google.android.gms               I  Selected local version of com.google.android.gms.googlecertificates
com.google.android.gms               I  Computing pending module set with APKs: [[AdsFdrDynamite.integ:21460000000], [Cronetdynamite:202414000700], [Dynamiteloader:202414000700], [Dynamitemodulesa:202414000000], [Dynamitemodulesc:202414000000], [Googlecertificates:202414000000], [Mapsdynamite:202414000000], [Measurementdynamite:202414000000]]

Also I see stuff like this when re-running the app (though it runs fine now w/ART rather than Dalvik):

2023-01-07 13:17:59.414  4573-4577  dex2oat                 pid-4573                             W  Before Android 4.1, method int androidx.appcompat.widget.DropDownListView.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
2023-01-07 13:17:59.464  4573-4579  dex2oat                 pid-4573                             W  Before Android 4.1, method int androidx.appcompat.widget.MenuPopupWindow$MenuDropDownListView.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView

I'm attaching a fuller log of the Play store crash.

Uninformed theory: this seems to be a bug with the app trying to use the DynamiteModule in Dalvik, at least on the emulator, and it cant' find something and dies.

Looking forward to a fix!  Thx!
playstorecrash.txt

Mobile Ads SDK Forum Advisor

unread,
Jan 9, 2023, 1:15:48 PM1/9/23
to dubs...@gmail.com, google-adm...@googlegroups.com
Hello DS,

Thanks for the additional information.

According to the information online: "Dalvik is a discontinued process virtual machine (VM) in the Android operating system that executes applications written for Android. (Dalvik bytecode format is still used as a distribution format, but no longer at runtime in newer Android versions.)" As a result, I would need to take a deeper look and see whether it's supported by the Google Mobile Ads SDK.

Have you tried compiling and running the app in Android studio? If not, can you try it?

DS

unread,
Jan 9, 2023, 1:26:42 PM1/9/23
to Google Mobile Ads SDK Developers
Indeed, Dalvik was the runtime used before ART and was available in a "preview" mode in Android 4.4 Kitkat (API 19) and was standard in API 21 (Lollipop)-- however, I believe I saw this crash even on API 23, which uses ART by default-- you can reproduce the crash yourself with the diff to the demo app in previous messages in this thread.  The Google Moble Ads SDK should still support older APIs-- the latest supports API 19 and higher (which was Dalvik by default), and even using 20.6.0, which worked previously as far back as API 16, now crashes on 16, 19, and higher.

Re:  building/running the app in Android Studio- yes, this is what I've been using to build, and run in the Emulator, various api levels.  Again, see the instructions in this thread to reproduce the crash.

Thanks!

Mobile Ads SDK Forum Advisor

unread,
Jan 11, 2023, 12:00:58 PM1/11/23
to dubs...@gmail.com, google-adm...@googlegroups.com
Hello DS,

Thanks for the additional information.

We are currently looking into it, and will get back to you once there is an update.

Mobile Ads SDK Forum Advisor

unread,
Feb 6, 2023, 3:21:07 AM2/6/23
to dubs...@gmail.com, google-adm...@googlegroups.com
Hello DS,

While we are looking into the issue, can you update to use the latest Google Mobile Ads SDK and follow the instructions in Optimize initialization and ad loading guide, and check if the issue still persists?

Thanks!

DS

unread,
Feb 7, 2023, 12:56:55 AM2/7/23
to Google Mobile Ads SDK Developers
I had already tried updating to the latest 21.4.0 SDK (and therefore was forced to target 19 when I am actually targeting 16).  I am now trying another build on the newer 21.5.0 w/the emulator API 19.

(I have also now updated to AS Giraffe 2022.3.1 Canary 2 and
Both the OPTIMIZE_INITIALIZATION and OPTIMIZE_AD_LOADING flags were already set to true.)

The app appears to build/run correctly on the emulator with 21.5.0 on API 19.  This is good news for devices up to 19 it seems!

Now I'll go back to API 16 in the emulator, which is the actual targeted API level... which requires going back to 20.6.0 of the library...

And the crash persists in the emulator:

FATAL EXCEPTION: Thread-122

                                                                                                    java.lang.VerifyError: com/google/android/gms/dynamite/DynamiteModule
                                                                                                        at com.google.android.gms.internal.ads.zzcjd.zzc(com.google.android.gms:play-services-ads-lite@@20.6.0:1)
                                                                                                        at com.google.android.gms.internal.ads.zzcjd.zzb(com.google.android.gms:play-services-ads-lite@@20.6.0:1)
                                                                                                        at com.google.android.gms.internal.ads.zzbwz.run(com.google.android.gms:play-services-ads-lite@@20.6.0:11)
                                                                                                        at java.lang.Thread.run(Thread.java:856)

I am wondering if a "20.6.1" needs to be issued which fixes the problem for API 16 or perhaps the emulator needs to be updated to handle the DynamiteModule.  Or perhaps 21.5.0 could be made compatible going back to API 16 somehow as it apparently has some fix in it (?)

Thanks!

Mobile Ads SDK Forum Advisor

unread,
Feb 10, 2023, 4:45:51 AM2/10/23
to dubs...@gmail.com, google-adm...@googlegroups.com
Hello DS,

Thanks for the details! 

Publishers should use the latest Google Mobile Ads SDK version (which is 21.5.0 now) with the minimum Android API level 19 to run.

For every fix that we add, it will only be in the newer version, where the minimum Android API level will only increase (but not drop back to 16).

DS

unread,
Feb 11, 2023, 12:34:50 AM2/11/23
to Google Mobile Ads SDK Developers
So even older ads-sdks which were working previously are unbuildable (or will crash) now if we still want to support API 16

FWIW, I also tried building with 20.6.0 for the new UpsideDownCake Android 14 preview (compileSdkPreview = "UpsideDownCake", targetSdkPreview = "UpsideDownCake", etc.) and got a similar crash.  Not a verifyerror this time, but still a problem with dynamite:

FATAL EXCEPTION: AdWorker(Default) #2
                                                                                                    Process: com.example.myapp, PID: 8108
                                                                                                    java.lang.SecurityException: Writable dex file '/data/user/0/com.example.myapp/cache/1646555424545.jar' is not allowed.
                                                                                                        at dalvik.system.DexFile.openDexFileNative(Native Method)
                                                                                                        at dalvik.system.DexFile.openDexFile(DexFile.java:406)
                                                                                                        at dalvik.system.DexFile.<init>(DexFile.java:128)
                                                                                                        at dalvik.system.DexFile.<init>(DexFile.java:101)
                                                                                                        at dalvik.system.DexPathList.loadDexFile(DexPathList.java:438)
                                                                                                        at dalvik.system.DexPathList.makeDexElements(DexPathList.java:397)
                                                                                                        at dalvik.system.DexPathList.<init>(DexPathList.java:166)
                                                                                                        at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:160)
                                                                                                        at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:105)
                                                                                                        at dalvik.system.DexClassLoader.<init>(DexClassLoader.java:55)
                                                                                                        at adu.t(:com.google.android.gms.policy_ads_fdr_dynamite@224400003@224400003057.484457631.484457631:22)
                                                                                                        at adu.v(:com.google.android.gms.policy_ads_fdr_dynamite@224400003@224400003057.484457631.484457631:1)
                                                                                                        at com.google.android.gms.ads.internal.i.q(:com.google.android.gms.policy_ads_fdr_dynamite@224400003@224400003057.484457631.484457631:3)
                                                                                                        at com.google.android.gms.ads.internal.i.run(:com.google.android.gms.policy_ads_fdr_dynamite@224400003@224400003057.484457631.484457631:4)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)

Updating the ads library to 21.5.0 (and updating minimumSdk to 19) results in the same error, also in the Android 14 UpsideDownCake preview:

AndroidRuntime          com.example.myapp              E  FATAL EXCEPTION: AdWorker(Default) #1
                                                                                                    Process: com.example.myapp, PID: 8430
                                                                                                    java.lang.SecurityException: Writable dex file '/data/user/0/com.example.myapp/cache/1646555424545.jar' is not allowed.
                                                                                                        at dalvik.system.DexFile.openDexFileNative(Native Method)
                                                                                                        at dalvik.system.DexFile.openDexFile(DexFile.java:406)
                                                                                                        at dalvik.system.DexFile.<init>(DexFile.java:128)
                                                                                                        at dalvik.system.DexFile.<init>(DexFile.java:101)
                                                                                                        at dalvik.system.DexPathList.loadDexFile(DexPathList.java:438)
                                                                                                        at dalvik.system.DexPathList.makeDexElements(DexPathList.java:397)
                                                                                                        at dalvik.system.DexPathList.<init>(DexPathList.java:166)
                                                                                                        at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:160)
                                                                                                        at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:105)
                                                                                                        at dalvik.system.DexClassLoader.<init>(DexClassLoader.java:55)
                                                                                                        at adu.t(:com.google.android.gms.policy_ads_fdr_dynamite@224400003@224400003057.484457631.484457631:22)
                                                                                                        at adu.v(:com.google.android.gms.policy_ads_fdr_dynamite@224400003@224400003057.484457631.484457631:1)
                                                                                                        at com.google.android.gms.ads.internal.i.q(:com.google.android.gms.policy_ads_fdr_dynamite@224400003@224400003057.484457631.484457631:3)
                                                                                                        at com.google.android.gms.ads.internal.i.run(:com.google.android.gms.policy_ads_fdr_dynamite@224400003@224400003057.484457631.484457631:4)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)

Not sure what's up cuz this is building with all the latest stuff-- latest emulator, latest Android Studio Canary, latest ads SDK, and newest emulator image for Android 14.

Very odd that it's invoking Dynamite in the stacktrace, just like on api 16.  Could be completely different tho.  The other issue doesn't seem permission-related tho. No clue what it's trying to write to the /cache/ directory or why it's having an issue, considering it *should* be able to write in the /cache directory.

Anyway, thanks

Patrick

unread,
Apr 13, 2023, 5:33:13 AM4/13/23
to Google Mobile Ads SDK Developers
Maybe this will need a new thread entirely for the Android 14 error, because I can still reproduce this crash with 
- GMS SDK  22.0.0
- UpsideDownCake SDK Revision 3
- Android 14 Beta 1 installed on Device
- Build-Tools Version 34.0.0-rc3

Probably this has to do with the new Dynamic code loading policies in Android 14

Mobile Ads SDK Forum Advisor

unread,
Apr 13, 2023, 11:44:04 PM4/13/23
to p.heu...@radio.net, google-adm...@googlegroups.com
Hello Patrick,


Thanks for the additional information.

I will bring this to the team and do further investigation.

617673185

unread,
Apr 13, 2023, 11:57:56 PM4/13/23
to Mobile Ads SDK Forum Advisor, p.heu...@radio.net, google-adm...@googlegroups.com
it's like this 


------------------ 原始邮件 ------------------
发件人: "Mobile Ads SDK Forum Advisor" <google-adm...@googlegroups.com>;
发送时间: 2023年4月14日(星期五) 中午11:43
主题: Re: [google-admob-ads-sdk] VerifyError in older API emulator on startup
--

---
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/jA6Pr000000000000000000000000000000000000000000000RT36CT00Lk5_f-l3QDOT6diQS6YoCA%40sfdc.net.
BCDED83A@CB937C67.F2CD3864.png.jpg
Reply all
Reply to author
Forward
0 new messages