AppCompatDelegate.setDefaultNightMode force closes app with no error - android

I am trying to add a night mode to my app but the app just closes each time it switches between day/night modes on my main screen. It just closes out the app, no error, no crash, no log cat data, just closes. Has anyone seen this happen before and is there a better way I can see why?
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
Here is the data from my debug session:
V/FA: Activity resumed, time: 455508700
V/FA: Connection attempt already in progress
D/ViewRootImpl#560a619[dashboard]: setView = DecorView#ae2f610[dashboard] TM=true MM=false
D/ViewRootImpl#560a619[dashboard]: Relayout returned: old=[0,0][1080,2280] new=[0,0][1080,2280] req=(1080,2280)0 dur=11 res=0x7 s={true 540690239488} ch=true
D/OpenGLRenderer: createReliableSurface : 0x7e71cddc80, 0x7de3a65000
D/OpenGLRenderer: SurfaceChanged : 0x0 -> 0x7e109da080
E/ViewRootImpl: sendUserActionEvent() mView returned.
I/TextToSpeech: Connected to ComponentInfo{com.samsung.SMT/com.samsung.SMT.SamsungTTSService}
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 3
I/TextToSpeech: Set up connection to ComponentInfo{com.samsung.SMT/com.samsung.SMT.SamsungTTSService}
D/ViewRootImpl#560a619[dashboard]: Relayout returned: old=[0,0][1080,2280] new=[0,0][1080,2280] req=(1080,2280)0 dur=6 res=0x1 s={true 540690239488} ch=false
D/ViewRootImpl#560a619[dashboard]: MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager: prepareNavigationBarInfo() DecorView#ae2f610[dashboard]
getNavigationBarColor() -855310
D/InputMethodManager: prepareNavigationBarInfo() DecorView#ae2f610[dashboard]
getNavigationBarColor() -855310
V/InputMethodManager: Starting input: tba=com.mydrive ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager: startInputInner - Id : 0
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport: Input channel destroyed: 'ClientS', fd=239
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
D/ViewRootImpl#560a619[dashboard]: MSG_RESIZED: frame=[0,0][1080,2280] ci=[0,108][0,126] vi=[0,108][0,126] or=1
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 470
V/FA: Activity paused, time: 455509171
D/ViewRootImpl#560a619[dashboard]: MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager: prepareNavigationBarInfo() DecorView#ae2f610[dashboard]
getNavigationBarColor() -855310
E/libprocessgroup: set_timerslack_ns write failed: Operation not permitted
D/InputTransport: Input channel destroyed: 'ClientS', fd=245
I/Ads: Ad failed to load : 3
I/Ads: Ad failed to load : 3
D/ViewRootImpl#560a619[dashboard]: stopped(true) old=false
D/OpenGLRenderer: SurfaceChanged : 0x7e109da080 -> 0x0
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/m.mydrive: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)

Related

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?

Exception: Bad state: field does not exist within the DocumentSnapshotPlatform Flutter Firebase

when I try to launch my app it throws the error, I am using cloud firestore for my database.
I have created a custom class object in which it should return the database stored in my firestore database.
The string : 'coffee'
The document Id : 'id'
Collection : name
"new crew member"
srength
100
sugars
"0"
Exception:
Bad state: field does not exist within the DocumentSnapshotPlatform in debug console snippet :
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
D/EGL_emulation(10524): eglMakeCurrent: 0xe3b05780: ver 2 0 (tinfo 0xcbb977f0)
I/OpenGLRenderer(10524): Davey! duration=1640ms; Flags=1, IntendedVsync=21923234495143, Vsync=21924734495083, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=21924742691640, AnimationStart=21924742737640, PerformTraversalsStart=21924743916740, DrawStart=21924756908640, SyncQueued=21924762235840, SyncStart=21924765266540, IssueDrawCommandsStart=21924765562940, SwapBuffers=21924776192940, FrameCompleted=21924877730440, DequeueBufferDuration=27493000, QueueBufferDuration=464000,
Connecting to VM Service at ws://127.0.0.1:51346/EM9iZekSWt8=/ws
D/EGL_emulation(10524): eglMakeCurrent: 0xe0eb0140: ver 2 0 (tinfo 0xcbb97100)
D/eglCodecCommon(10524): setVertexArrayObject: set vao to 0 (0) 1 0
W/DynamiteModule(10524): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(10524): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(10524): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
W/sloo.coffee_da(10524): Unknown chunk type '200'.
I/sloo.coffee_da(10524): The ClassLoaderContext is a special shared library.
I/sloo.coffee_da(10524): The ClassLoaderContext is a special shared library.
I/sloo.coffee_da(10524): The ClassLoaderContext is a special shared library.
W/sloo.coffee_da(10524): Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
V/NativeCrypto(10524): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 294 native methods...
W/sloo.coffee_da(10524): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (light greylist, reflection)
I/ProviderInstaller(10524): Installed default security provider GmsCore_OpenSSL
════════ Exception caught by provider ══════════════════════════════════════════
The following assertion was thrown:
An exception was throw by _MapStream<QuerySnapshot<Map<String, dynamic>>, List<Coffee>> listened by
StreamProvider<List<Coffee>?>, but no `catchError` was provided.
Exception:
Bad state: field does not exist within the DocumentSnapshotPlatform
════════════════════════════════════════════════════════════════════════════════
W/sloo.coffee_da(10524): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (light greylist, reflection)
W/sloo.coffee_da(10524): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, linking)
W/sloo.coffee_da(10524): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, linking)
W/sloo.coffee_da(10524): Accessing hidden field Ljava/io/FileDescriptor;->descriptor:I (light greylist, JNI)
W/sloo.coffee_da(10524): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (light greylist, reflection)
W/sloo.coffee_da(10524): Accessing hidden method Ldalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy; (light greylist, linking)
W/sloo.coffee_da(10524): Accessing hidden method Ldalvik/system/BlockGuard$Policy;->onNetwork()V (light greylist, linking)
database.dart file looks like this :
class DatabaseService {
final String uid;
DatabaseService({required this.uid});
final CollectionReference<Map<String, dynamic>> coffeeCollection =
FirebaseFirestore.instance.collection('coffee');
Future updateUserData(String sugars, String name, int strength) async {
return await coffeeCollection.doc(uid).set({
'sugars': sugars,
'name': name,
'srength': strength,
});
}
List<Coffee> _coffeeListFromSnapshot(
QuerySnapshot<Map<String, dynamic>> snapshot) {
return snapshot.docs.map((doc) {
return Coffee(
name: doc.get('name') ?? '',
strength: doc.get('strength') ?? 0,
sugars: doc.get('sugars') ?? '0');
}).toList();
}
Stream<List<Coffee>> get coffee {
return coffeeCollection.snapshots().map(_coffeeListFromSnapshot);
}
}

Fatal Error while integrating Firestore in Android Studio Project

I am encountering an issue while integrating firestore to my android studio project but when I pressed the "Add" buttn to push my changes into firestore. I am getting below error:
01/11 12:07:05: Launching 'app' on Nexus 5X API 29 x86.
Install successfully finished in 2 s 590 ms.
$ adb shell am start -n "com.example.do_i_need_it/com.example.do_i_need_it.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 30760 on device '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/le.do_i_need_i: Not late-enabling -Xcheck:jni (already on)
E/le.do_i_need_i: Unknown bits set in runtime_flags: 0x8000
W/le.do_i_need_i: Unexpected CPU variant for X86 using defaults: x86
I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
D/FirebaseAuth: Notifying id token listeners about user ( AGjRfZa9HCZCPfxYsG3E6k6zMMu2 ).
I/FirebaseInitProvider: FirebaseApp initialization successful
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)
W/RenderThread: type=1400 audit(0.0:231): avc: denied { write } for name="property_service" dev="tmpfs" ino=7005 scontext=u:r:untrusted_app:s0:c133,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=com.example.do_i_need_it
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
W/le.do_i_need_i: 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)
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
I/le.do_i_need_i: Background concurrent copying GC freed 16663(7119KB) AllocSpace objects, 6(120KB) LOS objects, 49% free, 1836KB/3672KB, paused 506us total 112.513ms
D/HostConnection: HostConnection::get() New Host Connection established 0xd993f1e0, tid 30797
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 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_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit 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: 0xd991a240: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xd991a240: ver 2 0 (tinfo 0xd990f0b0)
W/Gralloc3: mapper 3.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xd993f320, tid 30797
HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 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_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
D/eglCodecCommon: allocate: Ask for block of size 0x1000
allocate: ioctl allocate returned offset 0x3ff805000 size 0x2000
D/EGL_emulation: eglMakeCurrent: 0xd991a240: ver 2 0 (tinfo 0xd990f0b0)
I/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzaq#71e031d
D/FirebaseAuth: Notifying id token listeners about user ( AGjRfZa9HCZCPfxYsG3E6k6zMMu2 ).
D/Login Account: signInWithEmail:success
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy#c4749b6
D/EGL_emulation: eglMakeCurrent: 0xd991a240: ver 2 0 (tinfo 0xd990f0b0)
D/EGL_emulation: eglMakeCurrent: 0xd991a240: ver 2 0 (tinfo 0xd990f0b0)
I/Choreographer: Skipped 31 frames! The application may be doing too much work on its main thread.
D/EGL_emulation: eglMakeCurrent: 0xd991a240: ver 2 0 (tinfo 0xd990f0b0)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J (greylist,core-platform-api, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Llibcore/io/Memory;->peekLong(JZ)J (greylist, reflection, allowed)
Accessing hidden method Llibcore/io/Memory;->pokeLong(JJZ)V (greylist, reflection, allowed)
Accessing hidden method Llibcore/io/Memory;->pokeInt(JIZ)V (greylist, reflection, allowed)
Accessing hidden method Llibcore/io/Memory;->peekInt(JZ)I (greylist, reflection, allowed)
Accessing hidden method Llibcore/io/Memory;->pokeByte(JB)V (greylist, reflection, allowed)
Accessing hidden method Llibcore/io/Memory;->peekByte(J)B (greylist, reflection, allowed)
Accessing hidden method Llibcore/io/Memory;->pokeByteArray(J[BII)V (greylist, reflection, allowed)
Accessing hidden method Llibcore/io/Memory;->peekByteArray(J[BII)V (greylist, reflection, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->arrayIndexScale(Ljava/lang/Class;)I (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
Accessing hidden field Ljava/nio/Buffer;->address:J (greylist, reflection, allowed)
Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, reflection, allowed)
Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, reflection, allowed)
Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, reflection, allowed)
Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, reflection, allowed)
Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, reflection, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/DynamiteModule: Local module descriptor class for providerinstaller not found.
I/DynamiteModule: Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller: Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
I/le.do_i_need_i: The ClassLoaderContext is a special shared library.
I/chatty: uid=10133(com.example.do_i_need_it) AsyncTask #1 identical 2 lines
I/le.do_i_need_i: The ClassLoaderContext is a special shared library.
W/le.do_i_need_i: Accessing hidden field Ldalvik/system/BaseDexClassLoader;->pathList:Ldalvik/system/DexPathList; (greylist, reflection, allowed)
Accessing hidden field Ldalvik/system/DexPathList;->nativeLibraryDirectories:Ljava/util/List; (greylist, reflection, allowed)
Accessing hidden field Ldalvik/system/DexPathList;->systemNativeLibraryDirectories:Ljava/util/List; (greylist, reflection, allowed)
Accessing hidden field Ldalvik/system/DexPathList;->nativeLibraryPathElements:[Ldalvik/system/DexPathList$NativeLibraryElement; (greylist, reflection, allowed)
Accessing hidden method Ldalvik/system/DexPathList;->makePathElements(Ljava/util/List;)[Ldalvik/system/DexPathList$NativeLibraryElement; (greylist, reflection, allowed)
V/NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 286 native methods...
W/le.do_i_need_i: Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (greylist, reflection, allowed)
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/ProviderInstaller: Installed default security provider GmsCore_OpenSSL
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
I/le.do_i_need_i: Background young concurrent copying GC freed 13026(940KB) AllocSpace objects, 2(104KB) LOS objects, 18% free, 2979KB/3665KB, paused 3.950ms total 132.783ms
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/Firestore: (22.0.0) [WriteStream]: (834a3ea) Stream closed with status: Status{code=UNAVAILABLE, description=null, cause=java.net.SocketException: socket failed: EPERM (Operation not permitted)
at java.net.Socket.createImpl(Socket.java:492)
at java.net.Socket.<init>(Socket.java:446)
at java.net.Socket.<init>(Socket.java:250)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:285)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:555)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
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:919)
}.
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/Firestore: (22.0.0) [WriteStream]: (834a3ea) Stream closed with status: Status{code=UNAVAILABLE, description=null, cause=java.net.SocketException: socket failed: EPERM (Operation not permitted)
at java.net.Socket.createImpl(Socket.java:492)
at java.net.Socket.<init>(Socket.java:446)
at java.net.Socket.<init>(Socket.java:250)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:285)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:555)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
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:919)
}.
W/Firestore: (22.0.0) [WriteStream]: (834a3ea) Stream closed with status: Status{code=UNAVAILABLE, description=null, cause=java.net.SocketException: socket failed: EPERM (Operation not permitted)
at java.net.Socket.createImpl(Socket.java:492)
at java.net.Socket.<init>(Socket.java:446)
at java.net.Socket.<init>(Socket.java:250)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:285)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:555)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
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:919)
}.
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/Firestore: (22.0.0) [WriteStream]: (834a3ea) Stream closed with status: Status{code=UNAVAILABLE, description=null, cause=java.net.SocketException: socket failed: EPERM (Operation not permitted)
at java.net.Socket.createImpl(Socket.java:492)
at java.net.Socket.<init>(Socket.java:446)
at java.net.Socket.<init>(Socket.java:250)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:285)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:555)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
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:919)
}.
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/Firestore: (22.0.0) [WriteStream]: (834a3ea) Stream closed with status: Status{code=UNAVAILABLE, description=null, cause=java.net.SocketException: socket failed: EPERM (Operation not permitted)
at java.net.Socket.createImpl(Socket.java:492)
at java.net.Socket.<init>(Socket.java:446)
at java.net.Socket.<init>(Socket.java:250)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:285)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:555)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
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:919)
}.
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/Firestore: (22.0.0) [WriteStream]: (834a3ea) Stream closed with status: Status{code=UNAVAILABLE, description=null, cause=java.net.SocketException: socket failed: EPERM (Operation not permitted)
at java.net.Socket.createImpl(Socket.java:492)
at java.net.Socket.<init>(Socket.java:446)
at java.net.Socket.<init>(Socket.java:250)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:285)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:555)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
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:919)
}.
W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
W/Firestore: (22.0.0) [WriteStream]: (834a3ea) Stream closed with status: Status{code=UNAVAILABLE, description=null, cause=java.net.SocketException: socket failed: EPERM (Operation not permitted)
at java.net.Socket.createImpl(Socket.java:492)
at java.net.Socket.<init>(Socket.java:446)
at java.net.Socket.<init>(Socket.java:250)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:285)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:555)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
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:919)
}.
I have checked the device has internet connectivity and able to access to Internet, also, it work fine on the Firebase Authentication.
My code:
FirebaseFirestore db = FirebaseFirestore.getInstance();
Map<String,Object> products = new HashMap<>();
products.put("title",productTitle);
products.put("price",productPrice);
products.put("webpage",productWebPage);
products.put("userId","asa");
db.collection("products").add(products).addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
#Override
public void onSuccess(DocumentReference documentReference) {
Toast.makeText(c,"Added", Toast.LENGTH_LONG).show();
}
}).addOnFailureListener(new OnFailureListener() {
#Override
public void onFailure(#NonNull Exception e) {
Toast.makeText(c,e.getMessage(), Toast.LENGTH_LONG).show();
}
});
*Currently, I have Firebase Authentication integrated in my environment (which is working fine at the moment).
I have checked with Firebase documentation and follow those guidelines accordingly but the problem still persisted.
Thanks.
Try to debug a code or make a log to show what happed with your code.

DownloadManager - Download Fails Even with Proper Permissions

Running Android 9 (28) in an emulator, and can't seem to get my application to download anything. I've made sure the correct permissions are assigned, but it still says "Download unsuccessful."
package com.example.download_test;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.app.DownloadManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
Log.d("dm","We in bois");
super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_main);
getZipFile();
Log.d("dm","it should have worked yikes");
}
private int REQUEST_WRITE_EXTERNAL_STORAGE = 1;
private String extension;
public void getZipFile() {
int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_WRITE_EXTERNAL_STORAGE);
Log.e("dm","Permissions no worky");
} else {
//TODO
if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
Log.v("dm","Permission is granted");
//File write logic here
extension =".zip";
Uri uri = Uri.parse("http://ipv4.download.thinkbroadband.com/5MB.zip");
Log.d("dm","URI Parsed");
DownloadManager downloadmanager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
DownloadManager.Request request = new DownloadManager.Request(uri);
request.setTitle("5MB.zip");
request.allowScanningByMediaScanner();
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "5MB" + extension);
request.setMimeType("application/zip");
request.setNotificationVisibility(1);
downloadmanager.enqueue(request);
Log.i("dm", "Download requested");
}
}
}
}
Here's the error:
My apologies if this is trivial, I'm just trying to learn about Android.
Edit: I should have mentioned this originally, but Android Studio doesn't output an error when compiling.
Edit 2: I tried with a small txt file (https://www.w3.org/TR/PNG/iso_8859-1.txt) and it worked! I also found that trying to download a small txt over regular HTTP does not work. A ZIP file over HTTPS still doesn't work either, though.
Logcat output with 5MB ZIP file over HTTP:
2020-10-12 10:26:01.427 3955-3955/? I/e.download_tes: Not late-enabling -Xcheck:jni (already on)
2020-10-12 10:26:01.444 3955-3955/? W/e.download_tes: Unexpected CPU variant for X86 using defaults: x86_64
2020-10-12 10:26:01.752 3955-3955/com.example.download_test D/dm: We in bois
2020-10-12 10:26:01.762 3955-3955/com.example.download_test W/e.download_tes: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
2020-10-12 10:26:01.762 3955-3955/com.example.download_test W/e.download_tes: Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
2020-10-12 10:26:01.762 3955-3955/com.example.download_test W/e.download_tes: Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
2020-10-12 10:26:01.762 3955-3955/com.example.download_test W/e.download_tes: Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
2020-10-12 10:26:01.762 3955-3955/com.example.download_test W/e.download_tes: Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
2020-10-12 10:26:01.773 3955-3955/com.example.download_test V/dm: Permission is granted
2020-10-12 10:26:01.773 3955-3955/com.example.download_test D/dm: URI Parsed
2020-10-12 10:26:01.807 3955-3955/com.example.download_test I/dm: Download requested
2020-10-12 10:26:01.807 3955-3955/com.example.download_test D/dm: it should have worked yikes
2020-10-12 10:26:01.931 3955-3955/com.example.download_test W/e.download_tes: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
2020-10-12 10:26:01.932 3955-3955/com.example.download_test W/e.download_tes: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
2020-10-12 10:26:01.946 3955-3955/com.example.download_test W/e.download_tes: Accessing hidden method Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; (light greylist, linking)
2020-10-12 10:26:01.970 3955-3955/com.example.download_test D/OpenGLRenderer: HWUI GL Pipeline
2020-10-12 10:26:02.025 3955-3984/com.example.download_test I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-10-12 10:26:02.025 3955-3984/com.example.download_test I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2020-10-12 10:26:02.025 3955-3984/com.example.download_test I/OpenGLRenderer: Initialized EGL, version 1.4
2020-10-12 10:26:02.025 3955-3984/com.example.download_test D/OpenGLRenderer: Swap behavior 1
2020-10-12 10:26:02.026 3955-3984/com.example.download_test W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2020-10-12 10:26:02.026 3955-3984/com.example.download_test D/OpenGLRenderer: Swap behavior 0
2020-10-12 10:26:02.061 3955-3984/com.example.download_test D/EGL_emulation: eglCreateContext: 0x715ffe6444a0: maj 2 min 0 rcv 2
2020-10-12 10:26:02.088 3955-3984/com.example.download_test D/EGL_emulation: eglMakeCurrent: 0x715ffe6444a0: ver 2 0 (tinfo 0x715ffe60dc20)
2020-10-12 10:26:02.168 3955-3984/com.example.download_test D/EGL_emulation: eglMakeCurrent: 0x715ffe6444a0: ver 2 0 (tinfo 0x715ffe60dc20)
2020-10-12 10:26:17.002 3955-3984/com.example.download_test D/EGL_emulation: eglMakeCurrent: 0x715ffe6444a0: ver 2 0 (tinfo 0x715ffe60dc20)
and Manifest Permissions:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
Edit 3: Looks like I can download any size file (zip or txt) over HTTPS, but not over HTTP. Not sure if this is just standard behavior for DownloadManager.

Flutter flutter_native_admob package failing to load add

I'm trying to display my admob ads in my app natively with the flutter_native_admob package but for some reason the test ad never loads.
I get the following errors.
I/ple.XXXXXXXXap( 6263): The ClassLoaderContext is a special shared library.
I/chatty ( 6263): uid=10091(com.example.XXXXXXXXapp) identical 1 line
I/ple.XXXXXXXXap( 6263): The ClassLoaderContext is a special shared library.
I/DynamiteModule( 6263): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21400
I/DynamiteModule( 6263): Selected remote version of com.google.android.gms.ads.dynamite, version >= 21400
D/DynamitePackage( 6263): Instantiated singleton DynamitePackage.
D/DynamitePackage( 6263): Instantiating com.google.android.gms.ads.ChimeraAdLoaderBuilderCreatorImpl
D/NetworkSecurityConfig( 6263): No Network Security Config specified, using platform default
I/Ads ( 6263): This request is sent from a test device.
W/ple.XXXXXXXXap( 6263): Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
I/DynamiteModule( 6263): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21400
I/DynamiteModule( 6263): Selected remote version of com.google.android.gms.ads.dynamite, version >= 21400
I/ple.XXXXXXXXap( 6263): The ClassLoaderContext is a special shared library.
I/WebViewFactory( 6263): Loading com.android.chrome version 69.0.3497.100 (code 349710067)
I/ple.XXXXXXXXap( 6263): The ClassLoaderContext is a special shared library.
I/ple.XXXXXXXXap( 6263): Background concurrent copying GC freed 32981(5MB) AllocSpace objects, 16(340KB) LOS objects, 49% free, 3MB/6MB, paused 81.243ms total 180.818ms
E/FA ( 6263): GoogleService failed to initialize, status: 10, Missing google app id value from from string resources with name google_app_id.
I/FA ( 6263): App measurement is starting up, version: 18102
I/FA ( 6263): To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/FA ( 6263): To enable faster debug mode event logging run:
I/FA ( 6263): adb shell setprop debug.firebase.analytics.app com.example.XXXXXXXXapp
E/FA ( 6263): Missing google_app_id. Firebase Analytics disabled. See https://goo(.)gl/NAOOOI
E/FA ( 6263): Uploading is not possible. App measurement disabled
I/cr_LibraryLoader( 6263): Time to load native libraries: 2 ms (timestamps 6211-6213)
I/chromium( 6263): [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_LibraryLoader( 6263): Expected native library version number "69.0.3497.100", actual native library version number "69.0.3497.100"
E/cr_VariationsUtils( 6263): Failed reading seed file "/data/user/0/com.example.XXXXXXXXapp/app_webview/variations_seed": /data/user/0/com.example.XXXXXXXXapp/app_webview/variations_seed (No such file or directory)
W/cr_ChildProcLH( 6263): Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
I/cr_BrowserStartup( 6263): Initializing chromium process, singleProcess=false
W/ple.XXXXXXXXap( 6263): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;-><init>(Landroid/content/Context;I)V (light greylist, reflection)
W/ple.XXXXXXXXap( 6263): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->logEvent(Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;)V (light greylist, reflection)
W/ple.XXXXXXXXap( 6263): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionStarted(I)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
W/ple.XXXXXXXXap( 6263): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(II)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
W/ple.XXXXXXXXap( 6263): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
W/ple.XXXXXXXXap( 6263): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextSelection;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
W/ple.XXXXXXXXap( 6263): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(III)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
W/ple.XXXXXXXXap( 6263): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(IIILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
D/ ( 6263): HostConnection::get() New Host Connection established 0x71de949fcf60, tid 6511
W/cr_media( 6263): Requires BLUETOOTH permission
E/chromium( 6263): [ERROR:gl_surface_egl.cc(335)] eglChooseConfig failed with error EGL_SUCCESS
D/EGL_emulation( 6263): eglCreateContext: 0x71de947c2d60: maj 2 min 0 rcv 2
D/EGL_emulation( 6263): eglMakeCurrent: 0x71de947c2d60: ver 2 0 (tinfo 0x71de919c6660)
I/Choreographer( 6263): Skipped 33 frames! The application may be doing too much work on its main thread.
W/VideoCapabilities( 6263): Unrecognized profile 4 for video/hevc
I/VideoCapabilities( 6263): Unsupported profile 4 for video/mp4v-es
W/cr_MediaCodecUtil( 6263): HW encoder for video/avc is not available on this device.
W/cr_CrashFileManager( 6263): /data/user/0/com.example.XXXXXXXXapp/cache/WebView/Crash Reports does not exist or is not a directory
I/System.out( 6263): onAdFailedToLoad errorCode = 0
I/Ads ( 6263): Ad failed to load : 0
E/chromium( 6263): [ERROR:gl_surface_egl.cc(335)] eglChooseConfig failed with error EGL_SUCCESS
D/EGL_emulation( 6263): eglCreateContext: 0x71de9b1ded80: maj 2 min 0 rcv 2
D/EGL_emulation( 6263): eglMakeCurrent: 0x71de9b1ded80: ver 2 0 (tinfo 0x71de919c6660)
I already added the
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-XXX~YYYY"/>
inside my application tag.
And I made sure to include the classpath 'com.google.gms:google-services:4.3.0' dependency and apply plugin: 'com.google.gms.google-services' in my build.gradle. I'm not quite sure how to resolve this.

Categories

Resources