'flutter admob issues on m1 mac for android

Admob for Android emulator IPixel_2_API_S:5554) hangs a lot with errors/warnings. It looks like something to do with com.google.android.gms.chimera, which I believe is connected to Firebase.

I'm not using Firebase, so I shouldn't be getting Firebase issues, it would seem...

I've updated everything I can think of: xcode, flutter, android studio (to m1 mac version)(I'm using vscode for development), sdks, and emulators. I also removed the gem pod (1.10.x) and installed the newer version using homebrew (1.11.3). (that helped a lot, actually - prior to that it didn't work at all...)

This is on an m1 Air with 16gb of memory and 500gb ssd, mostly empty - I don't think I'm running into resource issues.

Here's the initialization debug output:

E/ActivityThread( 5789): Failed to find provider info for com.google.android.gms.chimera
W/DynamiteModule( 5789): Failed to retrieve remote module version.
E/ActivityThread( 5789): Failed to find provider info for com.google.android.gms.chimera
W/DynamiteModule( 5789): Failed to retrieve remote module version.
I/DynamiteModule( 5789): Considering local module com.google.android.gms.measurement.dynamite:0 and remote module com.google.android.gms.measurement.dynamite:0
W/FA-Ads  ( 5789): Data collection startup failed. No data will be collected.
W/FA-Ads  ( 5789): com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
W/FA-Ads  ( 5789):  at com.google.android.gms.dynamite.DynamiteModule.load(com.google.android.gms:play-services-basement@@17.6.0:62)
W/FA-Ads  ( 5789):  at com.google.android.gms.internal.measurement.zzbs.zzc(com.google.android.gms:play-services-measurement-sdk-api@@18.0.3:2)
W/FA-Ads  ( 5789):  at com.google.android.gms.internal.measurement.zzal.zza(com.google.android.gms:play-services-measurement-sdk-api@@18.0.3:3)
W/FA-Ads  ( 5789):  at com.google.android.gms.internal.measurement.zzbh.run(com.google.android.gms:play-services-measurement-sdk-api@@18.0.3:2)
W/FA-Ads  ( 5789):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/FA-Ads  ( 5789):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/FA-Ads  ( 5789):  at java.lang.Thread.run(Thread.java:920)
W/FA-Ads  ( 5789): Failed to connect to measurement client.
E/ActivityThread( 5789): Failed to find provider info for com.google.android.gms.chimera
W/DynamiteModule( 5789): Failed to retrieve remote module version.
I/TetheringManager( 5789): registerTetheringEventCallback:com.example.admob_ads_in_flutter
I/Ads     ( 5789): Updating ad debug logging enablement.
I/WebViewFactory( 5789): Loading com.google.android.webview version 89.0.4385.0 (code 438500084)
2
D/nativeloader( 5789): classloader namespace configured for unbundled product apk. library_path=/product/app/WebViewGoogle64/lib/arm64:/product/app/WebViewGoogle64/WebViewGoogle64.apk!/lib/arm64-v8a:/product/app/TrichromeLibrary64/TrichromeLibrary64.apk!/lib/arm64-v8a:/product/lib64:/system/product/lib64
W/_ads_in_flutte( 5789): Accessing hidden method Landroid/os/Trace;->isTagEnabled(J)Z (unsupported, reflection, allowed)
W/_ads_in_flutte( 5789): Accessing hidden method Landroid/os/Trace;->traceBegin(JLjava/lang/String;)V (unsupported, reflection, allowed)
W/_ads_in_flutte( 5789): Accessing hidden method Landroid/os/Trace;->traceEnd(J)V (unsupported, reflection, allowed)
W/_ads_in_flutte( 5789): Accessing hidden method Landroid/os/Trace;->asyncTraceBegin(JLjava/lang/String;I)V (unsupported, reflection, allowed)
W/_ads_in_flutte( 5789): Accessing hidden method Landroid/os/Trace;->asyncTraceEnd(JLjava/lang/String;I)V (unsupported, reflection, allowed)
I/cr_LibraryLoader( 5789): Loaded native library version number "89.0.4385.0"
I/cr_CachingUmaRecorder( 5789): Flushed 4 samples from 4 histograms.
W/_ads_in_flutte( 5789): Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (unsupported, reflection, allowed)
D/HostConnection( 5789): createUnique: call
D/HostConnection( 5789): HostConnection::get() New Host Connection established 0xb400007528a2a910, tid 6058
D/HostConnection( 5789): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
W/cr_media( 5789): Requires BLUETOOTH permission
D/EGL_emulation( 5789): eglCreateContext: 0xb400007538a68ad0: maj 3 min 0 rcv 3
D/EGL_emulation( 5789): eglMakeCurrent: 0xb400007538a68ad0: ver 3 0 (tinfo 0x773f92c280) (first time)
I/Choreographer( 5789): Skipped 3535 frames!  The application may be doing too much work on its main thread.
D/EGL_emulation( 5789): eglCreateContext: 0xb400007538a67a30: maj 3 min 0 rcv 3
I/OpenGLRenderer( 5789): Davey! duration=58953ms; Flags=1, FrameTimelineVsyncId=2230, IntendedVsync=91422605990, Vsync=150339270300, OldestInputEvent=0, NewestInputEvent=0, HandleInputStart=150352187361, AnimationStart=150352191027, PerformTraversalsStart=150356848736, DrawStart=150357305861, FrameDeadline=91439272656, SyncQueued=150357898736, SyncStart=150358049236, IssueDrawCommandsStart=150358133777, SwapBuffers=150369144736, FrameCompleted=150375906527, DequeueBufferDuration=595667, QueueBufferDuration=310083, GpuCompleted=150375906527, SwapBuffersCompleted=150375906527,
W/Ads     ( 5789): Update ad debug logging enablement as false
D/EGL_emulation( 5789): eglCreateContext: 0xb400007538a6c1f0: maj 3 min 0 rcv 3
E/ActivityThread( 5789): Failed to find provider info for com.google.android.gms.chimera
W/DynamiteModule( 5789): Failed to retrieve remote module version.
I/DynamiteModule( 5789): Considering local module com.google.android.gms.ads.dynamite:214106404 and remote module com.google.android.gms.ads.dynamite:0
I/DynamiteModule( 5789): Selected local version of com.google.android.gms.ads.dynamite
W/Ads     ( 5789): #007 Could not call remote method. @2
W/Ads     ( 5789): com.google.android.gms.internal.ads.zzcjc: com.google.android.gms.dynamite.DynamiteModule$LoadingException: Failed to instantiate module class: com.google.android.gms.ads.measurement.DynamiteMeasurementManager
W/Ads     ( 5789):  at com.google.android.gms.internal.ads.zzcjd.zzb(com.google.android.gms:play-services-ads-lite@@20.6.0:2)
W/Ads     ( 5789):  at com.google.android.gms.internal.ads.zzbwz.run(com.google.android.gms:play-services-ads-lite@@20.6.0:11)
W/Ads     ( 5789):  at java.lang.Thread.run(Thread.java:920)
W/Ads     ( 5789): Caused by: com.google.android.gms.dynamite.DynamiteModule$LoadingException: Failed to instantiate module class: com.google.android.gms.ads.measurement.DynamiteMeasurementManager
W/Ads     ( 5789):  at com.google.android.gms.dynamite.DynamiteModule.instantiate(com.google.android.gms:play-services-basement@@17.6.0:3)
W/Ads     ( 5789):  at com.google.android.gms.internal.ads.zzcjd.zzb(com.google.android.gms:play-services-ads-lite@@20.6.0:1)
W/Ads     ( 5789):  ... 2 more
W/Ads     ( 5789): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.measurement.DynamiteMeasurementManager" on path: DexPathList[[zip file "/data/app/~~u2YMbPrhFqwyVDcvr188CQ==/com.example.admob_ads_in_flutter-HQhgNc0mffU1zJMsS97zmw==/base.apk"],nativeLibraryDirectories=[/data/app/~~u2YMbPrhFqwyVDcvr188CQ==/com.example.admob_ads_in_flutter-HQhgNc0mffU1zJMsS97zmw==/lib/arm64, /data/app/~~u2YMbPrhFqwyVDcvr188CQ==/com.example.admob_ads_in_flutter-HQhgNc0mffU1zJMsS97zmw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
W/Ads     ( 5789):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
W/Ads     ( 5789):  at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
W/Ads     ( 5789):  at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
W/Ads     ( 5789):  at com.google.android.gms.dynamite.DynamiteModule.instantiate(com.google.android.gms:play-services-basement@@17.6.0:1)
W/Ads     ( 5789):  ... 3 more
E/cr_PlatformSer-Internal( 5789): UsageReporting query failed
E/GmsClientSupervisor( 5789): Timeout waiting for ServiceConnection callback com.google.android.gms.usagereporting.service.START
E/GmsClientSupervisor( 5789): java.lang.Exception
E/GmsClientSupervisor( 5789):   at Zv.handleMessage(chromium-TrichromeWebViewGoogle6432.apk-stable-438500084:10)
E/GmsClientSupervisor( 5789):   at android.os.Handler.dispatchMessage(Handler.java:102)
E/GmsClientSupervisor( 5789):   at zi0.dispatchMessage(chromium-TrichromeWebViewGoogle6432.apk-stable-438500084:1)
E/GmsClientSupervisor( 5789):   at android.os.Looper.loopOnce(Looper.java:201)
E/GmsClientSupervisor( 5789):   at android.os.Looper.loop(Looper.java:288)
E/GmsClientSupervisor( 5789):   at android.app.ActivityThread.main(ActivityThread.java:7858)
E/GmsClientSupervisor( 5789):   at java.lang.reflect.Method.invoke(Native Method)
E/GmsClientSupervisor( 5789):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/GmsClientSupervisor( 5789):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:984)

and then when it invokes the ad (after a long hang...)

E/ActivityThread( 5789): Failed to find provider info for com.google.android.gms.chimera
W/DynamiteModule( 5789): Failed to retrieve remote module version.
I/Ads     ( 5789): Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("B38BD7ADE9159ECDB44CB46670739E5F")) to get test ads on this device.
D/GASS    ( 5789): Clearcut logging disabled
D/zzams   ( 5789): File /data/user/0/com.example.admob_ads_in_flutter/cache/1633031840514.dex not found. No need for deletion
D/GASS    ( 5789): Clearcut logging disabled
E/ActivityThread( 5789): Failed to find provider info for com.google.android.gms.chimera
W/DynamiteModule( 5789): Failed to retrieve remote module version.
E/ActivityThread( 5789): Failed to find provider info for com.google.android.gms.chimera
W/ConnectionStatusConfig( 5789): Dynamic intent resolution failed: java.lang.IllegalArgumentException: Unknown authority com.google.android.gms.chimera
W/ConnectionStatusConfig( 5789): Dynamic lookup for intent failed for action: com.google.android.gms.appset.service.START
E/GmsClient( 5789): unable to connect to service: com.google.android.gms.appset.service.START on com.google.android.gms
I/Choreographer( 5789): Skipped 2399 frames!  The application may be doing too much work on its main thread.
D/EGL_emulation( 5789): eglCreateContext: 0xb400007538a76e50: maj 3 min 0 rcv 3
D/EGL_emulation( 5789): eglCreateContext: 0xb400007538a76830: maj 3 min 0 rcv 3
D/EGL_emulation( 5789): eglMakeCurrent: 0xb400007538a57810: ver 3 0 (tinfo 0x773f92c080) (first time)

It eventually shows the ad after three more long hangs, and then brings up a banner: 'Google Play Store Keeps Stopping' (don't know how that got into the act...)

It works great for the IOS emulator - no issues, no hangs, no warnings, no errors.

It also works fine (for android) on a Linux dev environment (Fedora), so that's a workaround until this gets fixed.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source