Glide can't download image to ImageView - android

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!

Related

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.

Why Android Volley library is unable to connect asp.net web api?

I am trying to call asp.net web api from Android Client using Volley library. The .net API is working fine and listening ports are:
http://localhost:5000 and https://localhost:5001 in my local machine.
But,When, I try to run android client keeping the base url as http://10.0.2.2:5000/api/login
I found below error in console->
04/23 23:13:41: Launching 'app' on Nexus 6 API 24.
Install successfully finished in 9 s 435 ms.
$ adb shell am start -n "com.example.tourexpwip/com.example.tourexpwip.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 3662 on device 'Nexus_6_API_24 [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/art: Late-enabling -Xcheck:jni
W/art: Unexpected CPU variant for X86 using defaults: x86
W/System: ClassLoader referenced unknown path: /data/app/com.example.tourexpwip-1/lib/x86
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
I/System.out: URL: http://10.0.2.2:5000/api/login/
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/: HostConnection::get() New Host Connection established 0xa67ec7c0, tid 3662
E/Volley: [210] NetworkUtility.shouldRetryException: Unexpected response code 307 for http://10.0.2.2:5000/api/login/
D/: HostConnection::get() New Host Connection established 0xa67ecac0, tid 3683
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/EGL_emulation: eglCreateContext: 0xb5c05660: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xb5c05660: ver 2 0 (tinfo 0xb5c032b0)
W/System.err: com.android.volley.ServerError
at com.android.volley.toolbox.NetworkUtility.shouldRetryException(NetworkUtility.java:201)
W/System.err: at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:145)
at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:132)
W/System.err: at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)
I/Choreographer: Skipped 68 frames! The application may be doing too much work on its main thread.
D/EGL_emulation: eglMakeCurrent: 0xb5c05660: ver 2 0 (tinfo 0xb5c032b0)
I/Choreographer: Skipped 35 frames! The application may be doing too much work on its main thread.
The controller class for login in ASP.NET web api->
namespace TourExpWIP1.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class LoginController : ControllerBase
{
NetCoreAuthenticationContext dbContext = new NetCoreAuthenticationContext();
public string Post([FromBody] TblUser value)
{
if (dbContext.TblUser.Any(user => user.UserName.Equals(value.UserName)))
{
TblUser user = dbContext.TblUser.Where(u => u.UserName.Equals(value.UserName)).First();
var client_post_hash_password = Convert.ToBase64String(
Common.SaltHashPassword(
Encoding.ASCII.GetBytes(value.Password),
Convert.FromBase64String(user.Salt)));
if (client_post_hash_password.Equals(user.Password))
return JsonConvert.SerializeObject(user);
else return JsonConvert.SerializeObject("Wrong Password");
}
else
{
return JsonConvert.SerializeObject("user does not exists in db");
}
}
}
}
Try this
1.In Android Manifiest, in tag application add:
inside tag application add this tag:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
<application
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"
...
/>
2.With a corresponding network_security_config.xml in app/src/main/res/xml/:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
More details please find from here- Link

New Android App failing on repeated launch

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?

DeviceClient error when it calls method open

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.

Emulators can't load "libGLES_emulation" driver

I am in the process of setting up FirebaseUI using Google's guide but I suddenly got an error I can't seem to find a solution for. I'm pretty sure it has to do with my gradle, because I've tried commenting changes in my Java files, using my phone instead of an AVD, and other emulators to no avail. I've included what I got in the Run console, Manifest, and gradles. If you need more information, please let me know. Thanks!
EDIT: For those with the same issue, I think I fixed it by updating Google Play services on the API Q emulator (you have to sign in to Google Play first), then I added the following to the app-level gradle:
android {
...
compileOptions {
...
sourceCompatibility = 1.8
targetCompatibility = 1.8
...
}
...
}
I don't know how it worked, but I hope it does for you too.
Run (conflicts only)
...
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
...
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
E/vndksupport: Could not load /vendor/lib/egl/libGLES_emulation.so from sphal namespace: dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found.
E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): unknown
W/RenderThread: type=1400 audit(0.0:4480): avc: denied { write } for name="property_service" dev="tmpfs" ino=8377 scontext=u:r:untrusted_app_27:s0:c119,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
...
W/xample.litloca: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection)
Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection)
...
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
...
W/Gralloc3: mapper 3.x is not supported
Run (full)
09/07 19:52:53: Launching 'app' on Pixel 2 API Q.
$ adb shell am start -n "com.example.litlocal/com.example.litlocal.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Waiting for process to come online...
Connected to process 14608 on device 'Pixel_2_API_Q [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/xample.litloca: The ClassLoaderContext is a special shared library.
I/xample.litloca: The ClassLoaderContext is a special shared library.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
V/FA: Registered activity lifecycle callback
I/FirebaseInitProvider: FirebaseApp initialization successful
D/OpenGLRenderer: Skia GL Pipeline
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
E/vndksupport: Could not load /vendor/lib/egl/libGLES_emulation.so from sphal namespace: dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found.
E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): unknown
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
W/RenderThread: type=1400 audit(0.0:4449): avc: denied { write } for name="property_service" dev="tmpfs" ino=8377 scontext=u:r:untrusted_app_27:s0:c119,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
V/FA: onActivityCreated
W/xample.litloca: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection)
W/xample.litloca: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection)
D/: HostConnection::get() New Host Connection established 0xdc721500, tid 14666
D/: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_host_composition_v1 GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xdc7124e0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xdc7124e0: ver 3 0 (tinfo 0xdc708f60)
V/FA: Collection enabled
V/FA: App package, google app id: com.example.litlocal, 1:175514927228:android:47ec351c4609ff5c6609f9
W/Gralloc3: mapper 3.x is not supported
I/FA: App measurement is starting up, version: 18202
To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.litlocal
D/FA: Debug-level message logging enabled
D/: createUnique: call
D/: HostConnection::get() New Host Connection established 0xdc721640, tid 14666
D/: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_host_composition_v1 GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
D/EGL_emulation: eglMakeCurrent: 0xdc7124e0: ver 3 0 (tinfo 0xdc708f60)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0
I/xample.litloca: Background young concurrent copying GC freed 16987(4410KB) AllocSpace objects, 8(224KB) LOS objects, 78% free, 1696KB/7840KB, paused 6.401ms total 59.038ms
V/FA: Connecting to remote service
V/FA: Detected application was in foreground
V/FA: Session started, time: 27900964
D/FA: Setting user property (FE): _sid, 1567911177
V/FA: Connection attempt already in progress
I/FA: Tag Manager is not found and thus will not be used
D/FA: Logging event (FE): session_start(_s), Bundle[{ga_event_origin(_o)=auto, ga_session_id(_sid)=1567911177}]
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 27900309
D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_screen_class(_sc)=MainActivity, ga_screen_id(_si)=8377598752693967695}]
V/FA: Connection attempt already in progress
Connection attempt already in progress
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 6
V/FA: Inactivity, disconnecting from the service
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.litlocal">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MyApplication"
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/AppTheme">
<activity
android:name=".MainActivity"
android:label="LitLocal">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".CreateEventActivity"
android:label="#string/create_event_activity_name"/>
<activity
android:name=".SetEventLocationActivity"
android:label="#string/set_event_location_activity_name"/>
<activity
android:name=".LoginActivity"
android:label="#string/login_activity_name"/>
</application>
</manifest>
Gradle (Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Grade (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.litlocal"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "en"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
/*sourceCompatibility = 1.8
targetCompatibility = 1.8*/
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.2.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v8:0.9.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-firestore:21.0.0'
//implementation 'com.firebaseui:firebase-ui-database:5.1.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
// Tentative for login
//implementation 'com.squareup.picasso:picasso:2.71828'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.gms.google-services'
This worked for me:
android {
...
compileOptions {
...
sourceCompatibility = 1.8
targetCompatibility = 1.8
...
}
...
}

Categories

Resources