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.
Related
I'm running through this tutorial on building an android app with google maps built in. The first run I made was successful, but when I run the same thing successively, it crashes and cannot load.
Included here are the log for the successful run, and from the unsuccessful run:
- a non-exiting runtime exception
- the fatal unimplemented / null object reference exception
- a log about accessing hidden fields that's much longer than the equivalent message in the "correct" log
I'm unsure about what data is necessary, but there's a size limit on these questions, so let me know if there's any other info that could be helpful here.
Successful Launch:
01/01 13:45:52: Launching 'app' on Pixel 4 API 30.
Install successfully finished in 578 ms.
$ adb shell am start -n "com.example.zellishstories/com.example.zellishstories.MapsActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 12703 on device 'Pixel_4_API_30 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/.zellishstorie: Late-enabling -Xcheck:jni
I/.zellishstorie: Unquickening 12 vdex files!
W/.zellishstorie: Unexpected CPU variant for X86 using defaults: x86
I/.zellishstorie: The ClassLoaderContext is a special shared library.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
D/MapsInitializer: preferredRenderer: null
D/zzca: preferredRenderer: null
I/zzca: Making Creator dynamically
I/DynamiteModule: Considering local module com.google.android.gms.maps_dynamite:0 and remote module com.google.android.gms.maps_dynamite:201817000
Selected remote version of com.google.android.gms.maps_dynamite, version >= 201817000
V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
W/.zellishstorie: Unsupported class loader
W/.zellishstorie: Unsupported class loader
I/Google Maps Android API: Google Play services client version: 12451000
D/MapsInitializer: loadedRenderer: LEGACY
D/zzca: preferredRenderer: null
I/Google Maps Android API: Google Play services package version: 201817022
I/TetheringManager: registerTetheringEventCallback:com.example.zellishstories
W/.zellishstorie: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
D/HostConnection: HostConnection::get() New Host Connection established 0xf0c2eae0, tid 12733
D/HostConnection: 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_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xf0c2e370: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xf0c2e370: ver 2 0 (tinfo 0xf0f7d8b0) (first time)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
HostConnection::get() New Host Connection established 0xf0c2df10, tid 12733
D/goldfish-address-space: allocate: Ask for block of size 0x100
allocate: ioctl allocate returned offset 0x3f3ffe000 size 0x2000
D/HostConnection: 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_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
D/HostConnection: HostConnection::get() New Host Connection established 0xf0c2cf50, tid 12765
D/HostConnection: 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_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
D/EGL_emulation: eglCreateContext: 0xf0c2db20: maj 1 min 0 rcv 1
W/Gralloc4: allocator 3.x is not supported
D/EGL_emulation: eglMakeCurrent: 0xf0c2db20: ver 1 0 (tinfo 0xf0f7df70) (first time)
D/EGL_emulation: eglMakeCurrent: 0xf0c2db20: ver 1 0 (tinfo 0xf0f7df70) (first time)
W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
Selected remote version of com.google.android.gms.googlecertificates, version >= 4
W/.zellishstorie: Unsupported class loader
W/.zellishstorie: Unsupported class loader
Runtime Exception:
W/Resources: Drawable com.example.zellishstories:drawable/abc_ic_voice_search_api_material has unresolved theme attributes! Consider using Resources.getDrawable(int, Theme) or Context.getDrawable(int).
java.lang.RuntimeException
at android.content.res.Resources.getDrawable(Resources.java:899)
at com.google.maps.api.android.lib6.impl.at.e(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):6)
at com.google.maps.api.android.lib6.impl.r.<init>(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):30)
at com.google.maps.api.android.lib6.impl.bi.a(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):19)
at com.google.maps.api.android.lib6.impl.co.a(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):4)
at com.google.android.gms.maps.internal.o.a(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):21)
at cy.onTransact(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):4)
at android.os.Binder.transact(Binder.java:1043)
at com.google.android.gms.internal.maps.zza.zzH(com.google.android.gms:play-services-maps##18.0.0:2)
at com.google.android.gms.maps.internal.zzk.onCreateView(com.google.android.gms:play-services-maps##18.0.0:5)
at com.google.android.gms.maps.zzau.onCreateView(com.google.android.gms:play-services-maps##18.0.0:7)
at com.google.android.gms.dynamic.zad.zab(com.google.android.gms:play-services-base##18.0.0:2)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base##18.0.0:1)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreateView(com.google.android.gms:play-services-base##18.0.0:2)
at com.google.android.gms.maps.SupportMapFragment.onCreateView(com.google.android.gms:play-services-maps##18.0.0:1)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
at androidx.fragment.app.FragmentStateManager.ensureInflatedView(FragmentStateManager.java:386)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:281)
at androidx.fragment.app.FragmentLayoutInflaterFactory.onCreateView(FragmentLayoutInflaterFactory.java:140)
at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:135)
at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:319)
at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:298)
at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1067)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:995)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
at android.view.LayoutInflater.inflate(LayoutInflater.java:657)
at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
at com.example.zellishstories.databinding.ActivityMapsBinding.inflate(ActivityMapsBinding.java:36)
at com.example.zellishstories.databinding.ActivityMapsBinding.inflate(ActivityMapsBinding.java:30)
at com.example.zellishstories.MapsActivity.onCreate(MapsActivity.kt:22)
at android.app.Activity.performCreate(Activity.java:8000)
at android.app.Activity.performCreate(Activity.java:7984)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5456)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5362)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:58)
at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:5415)
at android.app.ActivityThread.access$3300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2076)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Fatal Exception:
D/skia: --- Failed to create image decoder with message 'unimplemented'
E/AndroidRuntime: FATAL EXCEPTION: GLThread 809
Process: com.example.zellishstories, PID: 12961
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
at com.google.maps.api.android.lib6.gmm6.vector.gl.aj.a(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):11)
at com.google.maps.api.android.lib6.gmm6.vector.gl.aj.<init>(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):3)
at com.google.maps.api.android.lib6.gmm6.vector.gl.g.<init>(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):23)
at com.google.maps.api.android.lib6.gmm6.vector.bt.b(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):20)
at com.google.maps.api.android.lib6.gmm6.vector.av.run(:com.google.android.gms.dynamite_mapsdynamite#201817052#20.18.17 (040700-0):56)
Weird hidden access note:
Accessing hidden field Ljava/lang/Thread;->EMPTY_STACK_TRACE:[Ljava/lang/StackTraceElement; (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->SUBCLASS_IMPLEMENTATION_PERMISSION:Ljava/lang/RuntimePermission; (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->lock:Ljava/lang/Object; (greylist, linking, allowed)
Accessing hidden field Ljava/lang/Thread;->daemon:Z (greylist, linking, allowed)
Accessing hidden field Ljava/lang/Thread;->stillborn:Z (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->threadLocals:Ljava/lang/ThreadLocal$ThreadLocalMap; (greylist, linking, allowed)
Accessing hidden field Ljava/lang/Thread;->inheritableThreadLocals:Ljava/lang/ThreadLocal$ThreadLocalMap; (greylist, linking, allowed)
Accessing hidden field Ljava/lang/Thread;->systemDaemon:Z (blacklist, linking, denied)
Accessing hidden field Ljava/lang/Thread;->started:Z (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->blockerLock:Ljava/lang/Object; (greylist-max-o, linking, denied)
Accessing hidden method Ljava/lang/Thread;->nextThreadNum()I (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->stillborn:Z (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->systemDaemon:Z (blacklist, linking, denied)
Accessing hidden field Ljava/lang/Thread;->started:Z (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->blockerLock:Ljava/lang/Object; (greylist-max-o, linking, denied)
Accessing hidden method Ljava/lang/Thread;->nextThreadNum()I (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->stillborn:Z (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->systemDaemon:Z (blacklist, linking, denied)
Accessing hidden field Ljava/lang/Thread;->started:Z (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->blockerLock:Ljava/lang/Object; (greylist-max-o, linking, denied)
Accessing hidden method Ljava/lang/Thread;->init(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;J)V (greylist-max-o, linking, denied)
Accessing hidden method Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;Ljava/security/AccessControlContext;)V (blacklist, linking, denied)
Accessing hidden field Ljava/lang/Thread;->stillborn:Z (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->systemDaemon:Z (blacklist, linking, denied)
Accessing hidden field Ljava/lang/Thread;->started:Z (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->blockerLock:Ljava/lang/Object; (greylist-max-o, linking, denied)
Accessing hidden method Ljava/lang/Thread;->nextThreadNum()I (greylist-max-o, linking, denied)
Accessing hidden field Ljava/lang/Thread;->stillborn:Z (greylist-max-o, linking, denied)
From what is seems in the Fatal Exception where it reads
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
at line 4, you try to get the width of a drawable which is loaded to null (probably an ImageView not defined (correctly) in the xml file).
Can you verify that all Views are defined correctly?
I'm using this sample code for Android from this page.
Just replaced the content of connstring from line 29 with "Hostname=<myHostname>.azureiotcentral.com;DeviceId=<myDevice>;SharedAccessKey=<myPrimaryKey>";
I'm using SAS Authentication.
The first error is when it tries to call client.open() (line 138).
It's giving me the following error each time when it's trying sending messages (line 122).
Connected to process 20170 on device '7.3_Foldable_API_30 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
No Network Security Config specified, using platform default
I/MultiDex: VM with version 2.1.0 has multidex support
Installing application
VM has multidex support, MultiDex support library is disabled.
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
I/TetheringManager: registerTetheringEventCallback:com.example.kttracking
W/System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
D/HostConnection: HostConnection::get() New Host Connection established 0xf03da8e0, tid 20194
D/HostConnection: 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_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
W/System.err: Exception while opening IoTHub connection: java.io.IOException: Could not open the connection
I/System.out: Shutting down...
I/System.out: Message Sent: "temperature":22.84, "humidity":48.31
W/System.err: Exception while sending event: java.lang.IllegalStateException: Cannot send event from an IoT Hub client that is closed.
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xf03f3ee0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xf03f3ee0: ver 3 0 (tinfo 0xf0738cf0) (first time)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
HostConnection::get() New Host Connection established 0xf03f3af0, tid 20194
D/goldfish-address-space: allocate: Ask for block of size 0x100
allocate: ioctl allocate returned offset 0x3fc01c000 size 0x2000
D/HostConnection: 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_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
I/System.out: Message Sent: "temperature":20.74, "humidity":31.12
W/System.err: Exception while sending event: java.lang.IllegalStateException: Cannot send event from an IoT Hub client that is closed.
I/System.out: Message Sent: "temperature":26.08, "humidity":43.27
W/System.err: Exception while sending event: java.lang.IllegalStateException: Cannot send event from an IoT Hub client that is closed.
What protocol are you using? Is that a MQTT? Also please check the version of the device client are you using.
Second thing that you can do is to try on a different device and see if the issue persists. at time certain devices do exhibit issues like this.
At the end I tried this library. It works.
I am switch from iOS to Android and try to download the image by URL, for this problem I find that a lot of developers prefer to use the Glide library, I am trying to download images but can't understand why I see the error image. Look please on my code and say what I am doing wrong?
This error happens with JPEG and PNG formats.
Glide version 4.12.0
Code:
val urlJpg = "http://developer.alexanderklimov.ru/android/images/android_cat.jpg"
lateinit var img: ImageView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
img = findViewById(R.id.imageView)
Glide.with(this) //1
.load(urlJpg)
.placeholder(R.drawable.ic_launcher_background)
.error(R.drawable.ic_launcher_foreground)
.into(img)
}
Log:
2021-04-01 11:49:04.750 18374-18374/? I/glideandpicass: Not late-enabling -Xcheck:jni (already on)
2021-04-01 11:49:04.828 18374-18374/? I/glideandpicass: Unquickening 12 vdex files!
2021-04-01 11:49:04.832 18374-18374/? W/glideandpicass: Unexpected CPU variant for X86 using defaults: x86
2021-04-01 11:49:05.517 18374-18374/com.example.testglideandpicasso D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-04-01 11:49:05.519 18374-18374/com.example.testglideandpicasso D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-04-01 11:49:05.593 18374-18404/com.example.testglideandpicasso D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
2021-04-01 11:49:05.607 18374-18404/com.example.testglideandpicasso D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
2021-04-01 11:49:05.626 18374-18404/com.example.testglideandpicasso D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
2021-04-01 11:49:05.984 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2021-04-01 11:49:05.986 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2021-04-01 11:49:06.119 18374-18374/com.example.testglideandpicasso W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a #GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
2021-04-01 11:49:06.390 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
2021-04-01 11:49:06.390 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
2021-04-01 11:49:06.390 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
2021-04-01 11:49:06.468 18374-18374/com.example.testglideandpicasso W/Glide: Load failed for http://developer.alexanderklimov.ru/android/images/android_cat.jpg with size [1173x746]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
2021-04-01 11:49:06.471 18374-18374/com.example.testglideandpicasso I/Glide: Root cause (1 of 1)
com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:98)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
Caused by: java.io.IOException: Cleartext HTTP traffic to developer.alexanderklimov.ru not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:93)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
2021-04-01 11:49:06.514 18374-18402/com.example.testglideandpicasso D/HostConnection: HostConnection::get() New Host Connection established 0xe8eece00, tid 18402
2021-04-01 11:49:06.532 18374-18402/com.example.testglideandpicasso D/HostConnection: 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_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
2021-04-01 11:49:06.582 18374-18402/com.example.testglideandpicasso W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2021-04-01 11:49:06.585 18374-18402/com.example.testglideandpicasso D/EGL_emulation: eglCreateContext: 0xe8eedc70: maj 3 min 0 rcv 3
2021-04-01 11:49:06.594 18374-18402/com.example.testglideandpicasso D/EGL_emulation: eglMakeCurrent: 0xe8eedc70: ver 3 0 (tinfo 0xe923a070) (first time)
2021-04-01 11:49:06.618 18374-18402/com.example.testglideandpicasso I/Gralloc4: mapper 4.x is not supported
2021-04-01 11:49:06.619 18374-18402/com.example.testglideandpicasso D/HostConnection: createUnique: call
2021-04-01 11:49:06.620 18374-18402/com.example.testglideandpicasso D/HostConnection: HostConnection::get() New Host Connection established 0xe8eed570, tid 18402
2021-04-01 11:49:06.621 18374-18402/com.example.testglideandpicasso D/goldfish-address-space: allocate: Ask for block of size 0x100
2021-04-01 11:49:06.621 18374-18402/com.example.testglideandpicasso D/goldfish-address-space: allocate: ioctl allocate returned offset 0x3f7ef4000 size 0x2000
2021-04-01 11:49:06.639 18374-18402/com.example.testglideandpicasso D/HostConnection: 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_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
Glide logs:
2021-04-01 11:49:06.119 18374-18374/com.example.testglideandpicasso W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a #GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
2021-04-01 11:49:06.468 18374-18374/com.example.testglideandpicasso W/Glide: Load failed for http://developer.alexanderklimov.ru/android/images/android_cat.jpg with size [1173x746]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
2021-04-01 11:49:06.471 18374-18374/com.example.testglideandpicasso I/Glide: Root cause (1 of 1)
com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:98)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
Caused by: java.io.IOException: Cleartext HTTP traffic to developer.alexanderklimov.ru not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:93)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
Adding Network Security Config xml file in manifest
res/xml/network_security_config.xml:
Create the Network security config.xml in resource xml folder.
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">developer.alexanderklimov.ru/</domain>
</domain-config>
</network-security-config>
Add the Network security config.xml in manifest like following.
<application
android:name=".MyApplication"
android:networkSecurityConfig="#xml/network_security_config" ... />
I examined the log and try solved my problem using this post Glide showing error: Failed to find GeneratedAppGlideModule
The example above will be good for some situation, but for my problem solution simple need to add allow clear HTTP traffic inside Manifest file.
android:usesCleartextTraffic="true"
All my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testglideandpicasso">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:usesCleartextTraffic="true"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.TestGlideAndPicasso">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I think you're missing INTERNET permission in your AndroidManifest.xml.
Please define permission before application element in AndroidManifest.xml file.
<uses-permission android:name="android.permission.INTERNET" />
Any internet request on Android platform must have this permission, for more permissions, please check android developer documentation: https://developer.android.com/reference/android/Manifest.permission?hl=en
Have a nice trip on your Android development!
I have just build a project with android kotlin but when I run the app it got crash, and in the logcat I found this error
java.lang.NullPointerException: DataBindingUtil.setConte….layout.activity_chapter) must not be null
ChapterActivity.kt
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import com.tutorial.kotlinfirebasecomicreader.Common.Common
import com.tutorial.kotlinfirebasecomicreader.Model.Comic
import com.tutorial.kotlinfirebasecomicreader.databinding.ActivityChapterBinding
class ChapterActivity : AppCompatActivity() {
private lateinit var binding: ActivityChapterBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, R.layout.activity_chapter)
binding.toolbar.title = Common.selected_comic!!.Name
binding.toolbar.setNavigationIcon(R.drawable.ic_baseline_chevron_left_24)
binding.toolbar.setNavigationOnClickListener {
finish() //GO BACK
}
binding.recyclerChapter.setHasFixedSize(true)
val layoutManager = LinearLayoutManager(this#ChapterActivity)
binding.recyclerChapter.layoutManager = layoutManager
binding.recyclerChapter.addItemDecoration(DividerItemDecoration(this, layoutManager.orientation))
fetchChapter (Common.selected_comic!!)
}
private fun fetchChapter(comic: Comic) {
Common.chapterList = comic.Chapters!!
binding.txtChapterName.text = StringBuilder("Chapter (")
.append(comic.Chapters!!.size)
.append(")")
}
}
I don't really know how to fix it and I need some help
Edited =>
activity_chapter.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<LinearLayout
android:orientation="vertical"
android:background="#android:color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ChapterActivity">
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar"
android:minHeight="?attr/actionBarSize"
app:titleTextColor="#color/textColor"
android:background="#color/columnColor"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:padding="16dp"
android:weightSum="4"
android:background="#color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/txt_chapter_name"
android:text="Chapter (10)"
android:textColor="#color/textColor"
android:textSize="20sp"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recycler_chapter"
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</layout>
Stack Trace =>
2021-03-04 11:55:23.033 11911-11911/? I/basecomicreade: Not late-enabling -Xcheck:jni (already on)
2021-03-04 11:55:23.106 11911-11911/? I/basecomicreade: Unquickening 13 vdex files!
2021-03-04 11:55:23.108 11911-11911/? W/basecomicreade: Unexpected CPU variant for X86 using defaults: x86_64
2021-03-04 11:55:23.913 11911-11911/com.tutorial.kotlinfirebasecomicreader W/ComponentDiscovery: Class com.google.firebase.dynamicloading.DynamicLoadingRegistrar is not an found.
2021-03-04 11:55:23.933 11911-11911/com.tutorial.kotlinfirebasecomicreader I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
2021-03-04 11:55:23.957 11911-11911/com.tutorial.kotlinfirebasecomicreader I/FirebaseInitProvider: FirebaseApp initialization successful
2021-03-04 11:55:24.001 11911-11932/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Unsupported class loader
2021-03-04 11:55:24.010 11911-11932/com.tutorial.kotlinfirebasecomicreader I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:46 and remote module com.google.android.gms.measurement.dynamite:45
2021-03-04 11:55:24.010 11911-11932/com.tutorial.kotlinfirebasecomicreader I/DynamiteModule: Selected local version of com.google.android.gms.measurement.dynamite
2021-03-04 11:55:24.053 11911-11937/com.tutorial.kotlinfirebasecomicreader D/libEGL: loaded /vendor/lib64/egl/libEGL_emulation.so
2021-03-04 11:55:24.055 11911-11937/com.tutorial.kotlinfirebasecomicreader D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2021-03-04 11:55:24.062 11911-11937/com.tutorial.kotlinfirebasecomicreader D/libEGL: loaded /vendor/lib64/egl/libGLESv2_emulation.so
2021-03-04 11:55:24.160 11911-11911/com.tutorial.kotlinfirebasecomicreader D/skia: Warning: an opaque image should be decoded as opaque - it is being decoded as non-opaque, which will draw slower
2021-03-04 11:55:24.200 11911-11932/com.tutorial.kotlinfirebasecomicreader V/FA: onActivityCreated
2021-03-04 11:55:24.250 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: App measurement collection enabled
2021-03-04 11:55:24.254 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: App measurement enabled for app package, google app id: com.tutorial.kotlinfirebasecomicreader, 1:705167416733:android:e2429adee28166ea782374
2021-03-04 11:55:24.256 11911-11938/com.tutorial.kotlinfirebasecomicreader I/FA: App measurement initialized, version: 39000
2021-03-04 11:55:24.256 11911-11938/com.tutorial.kotlinfirebasecomicreader I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
2021-03-04 11:55:24.257 11911-11938/com.tutorial.kotlinfirebasecomicreader I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.tutorial.kotlinfirebasecomicreader
2021-03-04 11:55:24.257 11911-11938/com.tutorial.kotlinfirebasecomicreader D/FA: Debug-level message logging enabled
2021-03-04 11:55:24.287 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2021-03-04 11:55:24.288 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2021-03-04 11:55:24.354 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connecting to remote service
2021-03-04 11:55:24.420 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
2021-03-04 11:55:24.476 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: HostConnection::get() New Host Connection established 0x7d323924d620, tid 11935
2021-03-04 11:55:24.490 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
2021-03-04 11:55:24.507 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
2021-03-04 11:55:24.509 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Activity resumed, time: 57788511
2021-03-04 11:55:24.600 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglCreateContext: 0x7d323924e840: maj 3 min 0 rcv 3
2021-03-04 11:55:24.680 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:24.690 11911-11938/com.tutorial.kotlinfirebasecomicreader I/FA: Tag Manager is not found and thus will not be used
2021-03-04 11:55:24.706 11911-11935/com.tutorial.kotlinfirebasecomicreader I/Gralloc4: mapper 4.x is not supported
2021-03-04 11:55:24.707 11911-11935/com.tutorial.kotlinfirebasecomicreader W/Gralloc3: mapper 3.x is not supported
2021-03-04 11:55:24.712 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: createUnique: call
2021-03-04 11:55:24.712 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: HostConnection::get() New Host Connection established 0x7d323924eac0, tid 11935
2021-03-04 11:55:24.713 11911-11935/com.tutorial.kotlinfirebasecomicreader D/eglCodecCommon: allocate: Ask for block of size 0x100
2021-03-04 11:55:24.713 11911-11935/com.tutorial.kotlinfirebasecomicreader D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3fe042000 size 0x2000
2021-03-04 11:55:24.716 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
2021-03-04 11:55:24.730 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:24.795 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
2021-03-04 11:55:24.797 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
2021-03-04 11:55:25.306 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=900ms; Flags=1, IntendedVsync=57788545708266, Vsync=57788579041598, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57788595779340, AnimationStart=57788595852830, PerformTraversalsStart=57788595904150, DrawStart=57788869782150, SyncQueued=57788872423620, SyncStart=57788883887770, IssueDrawCommandsStart=57788884972440, SwapBuffers=57789368117580, FrameCompleted=57789457618760, DequeueBufferDuration=307500, QueueBufferDuration=1103560, GpuCompleted=0,
2021-03-04 11:55:25.576 11911-11938/com.tutorial.kotlinfirebasecomicreader D/FA: Connected to remote service
2021-03-04 11:55:25.577 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Processing queued up service tasks: 5
2021-03-04 11:55:27.569 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Recording user engagement, ms: 3024
2021-03-04 11:55:27.599 11911-11932/com.tutorial.kotlinfirebasecomicreader V/FA: onActivityCreated
2021-03-04 11:55:27.787 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Activity paused, time: 57791583
2021-03-04 11:55:27.924 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Activity resumed, time: 57792074
2021-03-04 11:55:27.986 11911-11946/com.tutorial.kotlinfirebasecomicreader D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-03-04 11:55:27.994 11911-11911/com.tutorial.kotlinfirebasecomicreader E/RecyclerView: No adapter attached; skipping layout
2021-03-04 11:55:28.090 11911-11946/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Verification of java.util.Set com.android.org.conscrypt.SSLUtils.getSupportedClientKeyTypes(byte[], int[]) took 100.226ms (648.53 bytecodes/s) (3304B approximate peak alloc)
2021-03-04 11:55:28.260 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:28.732 11911-11946/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Verification of boolean com.android.org.conscrypt.CertBlacklistImpl.isHex(java.lang.String) took 124.689ms (288.72 bytecodes/s) (2168B approximate peak alloc)
2021-03-04 11:55:28.836 11911-11911/com.tutorial.kotlinfirebasecomicreader I/Choreographer: Skipped 51 frames! The application may be doing too much work on its main thread.
2021-03-04 11:55:28.880 11911-11930/com.tutorial.kotlinfirebasecomicreader I/basecomicreade: Waiting for a blocking GC ProfileSaver
2021-03-04 11:55:28.887 11911-11930/com.tutorial.kotlinfirebasecomicreader I/basecomicreade: WaitForGcToComplete blocked ProfileSaver on RunEmptyCheckpoint for 7.720ms
2021-03-04 11:55:29.270 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1239ms; Flags=0, IntendedVsync=57792137367431, Vsync=57792987367397, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57792988665860, AnimationStart=57792988801340, PerformTraversalsStart=57792989546070, DrawStart=57792989762430, SyncQueued=57792990250570, SyncStart=57792999374600, IssueDrawCommandsStart=57792999429610, SwapBuffers=57793072211200, FrameCompleted=57793385836850, DequeueBufferDuration=20442430, QueueBufferDuration=76115660, GpuCompleted=77309411328,
2021-03-04 11:55:29.691 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:29.792 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1803ms; Flags=1, IntendedVsync=57792137367431, Vsync=57792987367397, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57792988665860, AnimationStart=57792988801340, PerformTraversalsStart=57792989546070, DrawStart=57793838734440, SyncQueued=57793840519500, SyncStart=57793843650750, IssueDrawCommandsStart=57793843800190, SwapBuffers=57793936524990, FrameCompleted=57793943762960, DequeueBufferDuration=82930, QueueBufferDuration=274660, GpuCompleted=8810055295132672,
2021-03-04 11:55:29.797 11911-11911/com.tutorial.kotlinfirebasecomicreader I/Choreographer: Skipped 57 frames! The application may be doing too much work on its main thread.
2021-03-04 11:55:29.887 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:30.096 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1062ms; Flags=0, IntendedVsync=57792995727619, Vsync=57793945727581, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57793949431810, AnimationStart=57793949481480, PerformTraversalsStart=57793952149640, DrawStart=57793952476430, SyncQueued=57793953226090, SyncStart=57794142461760, IssueDrawCommandsStart=57794149759670, SwapBuffers=57794236027780, FrameCompleted=57794247497260, DequeueBufferDuration=296420, QueueBufferDuration=1234510, GpuCompleted=137654660947320,
2021-03-04 11:55:30.221 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:30.455 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1270ms; Flags=0, IntendedVsync=57792995727619, Vsync=57793945727581, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57793949431810, AnimationStart=57793949481480, PerformTraversalsStart=57793952149640, DrawStart=57794142711790, SyncQueued=57794142809910, SyncStart=57794483167180, IssueDrawCommandsStart=57794483392980, SwapBuffers=57794595122060, FrameCompleted=57794606716760, DequeueBufferDuration=131380, QueueBufferDuration=409730, GpuCompleted=137657109016869,
2021-03-04 11:55:30.456 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:30.511 11911-11911/com.tutorial.kotlinfirebasecomicreader D/Slider: onImageSlideChange() called with: position = [0]
2021-03-04 11:55:30.511 11911-11911/com.tutorial.kotlinfirebasecomicreader I/SlideIndicatorsGroup: onSlideChange: 0
2021-03-04 11:55:30.515 11911-11911/com.tutorial.kotlinfirebasecomicreader I/SlideIndicatorsGroup: onSlideChange: 0
2021-03-04 11:55:30.525 11911-11911/com.tutorial.kotlinfirebasecomicreader I/Choreographer: Skipped 42 frames! The application may be doing too much work on its main thread.
2021-03-04 11:55:30.608 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
2021-03-04 11:55:30.608 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
2021-03-04 11:55:30.608 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
2021-03-04 11:55:30.718 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:31.073 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1118ms; Flags=1, IntendedVsync=57793962375754, Vsync=57794662375726, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57794676994830, AnimationStart=57794677072830, PerformTraversalsStart=57794677609830, DrawStart=57794835905760, SyncQueued=57794837936740, SyncStart=57794982254730, IssueDrawCommandsStart=57794985287860, SwapBuffers=57795092878620, FrameCompleted=57795224849780, DequeueBufferDuration=215540, QueueBufferDuration=11529020, GpuCompleted=0,
2021-03-04 11:55:33.429 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Inactivity, disconnecting from the service
2021-03-04 11:55:35.432 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Recording user engagement, ms: 7288
2021-03-04 11:55:35.455 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connecting to remote service
2021-03-04 11:55:35.460 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Activity paused, time: 57799379
2021-03-04 11:55:35.589 11911-11932/com.tutorial.kotlinfirebasecomicreader V/FA: onActivityCreated
2021-03-04 11:55:35.668 11911-11911/com.tutorial.kotlinfirebasecomicreader D/AndroidRuntime: Shutting down VM
2021-03-04 11:55:35.669 11911-11911/com.tutorial.kotlinfirebasecomicreader E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tutorial.kotlinfirebasecomicreader, PID: 11911
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tutorial.kotlinfirebasecomicreader/com.tutorial.kotlinfirebasecomicreader.ChapterActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3344)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3488)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7506)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.intern
2021-03-04 11:55:35.782 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
The documentation says that DataBindingUtil.setContentView returns:
The binding associated with the inflated content view or null if the layoutId is not a data binding layout.
So I would have to assume that your layout is not a valid data binding layout, so the issue lies in your XML.
I would recommend reading: Binding expressions which shows you the syntax of a valid binding layout and also this: Data Binding Library fully to help get a comprehensive understanding.
Also the answer by #Teo does point out the recommended way to use data binding so unless you have a specific reason for using the generic version I would switch to that.
Can try to avoid using DataBindingUtil as it keeps return null in my case.
You can try using its own databinding.inflate, as it will always get the correct binding.
binding = ActivityChapterBinding.inflate(layoutInflater)
setContentView(binding.root)
This might sound dumb, but in my case, this happened after renaming a package
and I forgot to clean the project, if databinding refuses to detect the new package name, according to this answer try to disable databinding in Build.gradle (Module), sync then re-enable it
And if you're using google-services, you'll need to adjust the naming part for the google-services.json as well.
I have an android studio project where I am using a map view fragment. In my old project, it worked well and displayed a map, but in my new one, the map is just blank (grey). Even the google logo is missing on the map.
Here is my logcat error log:
2018-11-16 13:14:20.286 1627-5883/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=mls.client/.clientviews.MapActivity (has extras)} from uid 10020 on display 0
--------- beginning of main
2018-11-16 13:14:20.290 1372-1392/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 4547748 , only wrote 4547520
2018-11-16 13:14:20.303 6528-6528/? I/art: Not late-enabling -Xcheck:jni (already on)
2018-11-16 13:14:20.303 6528-6528/? W/art: Unexpected CPU variant for X86 using defaults: x86
2018-11-16 13:14:20.310 1627-1639/system_process I/ActivityManager: Start proc 6528:mls.client/u0a83 for activity mls.client/.clientviews.MapActivity
2018-11-16 13:14:20.330 1307-1323/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 1536000
2018-11-16 13:14:20.363 2148-2359/com.android.launcher3 D/EGL_emulation: eglMakeCurrent: 0x9fae0980: ver 3 0 (tinfo 0xa0d57ee0)
2018-11-16 13:14:20.500 6528-6528/mls.client W/System: ClassLoader referenced unknown path: /data/app/mls.client-1/lib/x86
2018-11-16 13:14:20.532 6528-6528/mls.client I/InstantRun: starting instant run server: is main process
2018-11-16 13:14:20.540 6528-6544/mls.client I/GMPM: App measurement is starting up
2018-11-16 13:14:20.545 6528-6544/mls.client E/GMPM: getGoogleAppId failed with status: 10
2018-11-16 13:14:20.546 6528-6544/mls.client E/GMPM: Uploading is not possible. App measurement disabled
2018-11-16 13:14:20.609 6528-6528/mls.client I/zzy: Making Creator dynamically
2018-11-16 13:14:20.614 6528-6528/mls.client W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
2018-11-16 13:14:20.621 6528-6528/mls.client W/System: ClassLoader referenced unknown path:
2018-11-16 13:14:20.621 6528-6528/mls.client W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
2018-11-16 13:14:20.664 6528-6528/mls.client I/Google Maps Android API: Google Play services client version: 8298000
2018-11-16 13:14:20.667 6528-6528/mls.client I/Google Maps Android API: Google Play services package version: 12874026
2018-11-16 13:14:20.706 6528-6528/mls.client E/art: The String#value field is not present on Android versions >= 6.0
2018-11-16 13:14:20.832 6528-6557/mls.client D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2018-11-16 13:14:20.899 1627-1741/system_process I/ActivityManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.google.android.packageinstaller cmp=com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity (has extras)} from uid 10083 on display 0
2018-11-16 13:14:20.910 1307-1355/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2018-11-16 13:14:20.982 6528-6584/mls.client I/OpenGLRenderer: Initialized EGL, version 1.4
2018-11-16 13:14:20.982 6528-6584/mls.client D/OpenGLRenderer: Swap behavior 1
2018-11-16 13:14:20.982 6528-6584/mls.client W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2018-11-16 13:14:20.982 6528-6584/mls.client D/OpenGLRenderer: Swap behavior 0
2018-11-16 13:14:20.986 6528-6584/mls.client D/EGL_emulation: eglCreateContext: 0xa3586320: maj 3 min 0 rcv 3
2018-11-16 13:14:20.989 6528-6584/mls.client D/EGL_emulation: eglMakeCurrent: 0xa3586320: ver 3 0 (tinfo 0xa3583ae0)
2018-11-16 13:14:20.990 6528-6584/mls.client E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
2018-11-16 13:14:20.991 6528-6584/mls.client E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
2018-11-16 13:14:21.015 6528-6528/mls.client W/art: Before Android 4.1, method int android.support.v7.internal.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
2018-11-16 13:14:21.024 6528-6584/mls.client D/EGL_emulation: eglMakeCurrent: 0xa3586320: ver 3 0 (tinfo 0xa3583ae0)
2018-11-16 13:14:21.099 1627-1813/system_process I/WindowManager: Destroying surface Surface(name=com.android.launcher3/com.android.launcher3.Launcher) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.destroyOrSaveSurface:2100 com.android.server.wm.AppWindowToken.destroySurfaces:363 com.android.server.wm.AppWindowToken.notifyAppStopped:389 com.android.server.wm.WindowManagerService.notifyAppStopped:4463 com.android.server.am.ActivityStack.activityStoppedLocked:1252 com.android.server.am.ActivityManagerService.activityStopped:6903
2018-11-16 13:14:21.109 1627-5883/system_process I/GnssLocationProvider: WakeLock acquired by sendMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest#88ac655)
2018-11-16 13:14:21.109 1627-1640/system_process I/GnssLocationProvider: WakeLock released by handleMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest#88ac655)
2018-11-16 13:14:21.111 1715-1906/com.android.systemui D/EGL_emulation: eglMakeCurrent: 0xa3585780: ver 3 0 (tinfo 0xa3583730)
2018-11-16 13:14:21.297 1627-1648/system_process I/WindowManager: Destroying surface Surface(name=Starting mls.client) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.destroyOrSaveSurface:2100 com.android.server.wm.AppWindowToken.destroySurfaces:363 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.WindowStateAnimator.stepAnimationLocked:491 com.android.server.wm.WindowAnimator.updateWindowsLocked:303 com.android.server.wm.WindowAnimator.animateLocked:704
2018-11-16 13:14:22.871 6528-6581/mls.client W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
2018-11-16 13:14:22.871 6528-6581/mls.client W/DynamiteModule: Failed to load module via V2: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.dynamite.DynamiteModule$DynamiteLoaderClassLoader" on path: DexPathList[[zip file "/data/app/mls.client-1/base.apk", zip file "/data/app/mls.client-1/split_lib_dependencies_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_0_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_1_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_2_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_3_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_4_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_5_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_6_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_7_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_8_apk.apk", zip file "/data/app/mls.client-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/mls.client-1/lib/x86, /system/lib, /vendor/lib]]
2018-11-16 13:14:22.875 6528-6581/mls.client I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
2018-11-16 13:14:22.875 6528-6581/mls.client I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 4
2018-11-16 13:14:23.516 1372-1393/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 4855373 , only wrote 4702320
Any idea what is going wrong with my MapView?
if you need more info or code, please write me.
Thanks.
You need to check if the Google Maps Android API is enabled in your Developer's Console. If it is, check if you put the Android API Key in the google_maps_api.xml
go to https://console.cloud.google.com/apis/credentials
update Application restrictions with used domains and API restrictions with used API.
the changes takes more than 5 mins to reflect