title: Fatal Error while integrating Firestore in Android Studio Project
body: <p>I am encountering an issue while integrating firestore to my android studio project but when I pressed the &quot;Add&quot; buttn to push my changes into firestore. I am getting below error:</p>
  <pre><code>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 &quot;com.example.do_i_need_it/com.example.do_i_need_it.LoginActivity&quot; -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 &quot;Logcat output&quot; section of the &quot;Debugger&quot; 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 &quot;qemu.gles&quot; to &quot;1&quot;: connection failed; errno=13 (Permission denied)
  W/RenderThread: type=1400 audit(0.0:231): avc: denied { write } for name=&quot;property_service&quot; dev=&quot;tmpfs&quot; 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;-&gt;computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
      Accessing hidden method Landroid/view/ViewGroup;-&gt;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;-&gt;getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;objectFieldOffset(Ljava/lang/reflect/Field;)J (greylist,core-platform-api, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Llibcore/io/Memory;-&gt;peekLong(JZ)J (greylist, reflection, allowed)
      Accessing hidden method Llibcore/io/Memory;-&gt;pokeLong(JJZ)V (greylist, reflection, allowed)
      Accessing hidden method Llibcore/io/Memory;-&gt;pokeInt(JIZ)V (greylist, reflection, allowed)
      Accessing hidden method Llibcore/io/Memory;-&gt;peekInt(JZ)I (greylist, reflection, allowed)
      Accessing hidden method Llibcore/io/Memory;-&gt;pokeByte(JB)V (greylist, reflection, allowed)
      Accessing hidden method Llibcore/io/Memory;-&gt;peekByte(J)B (greylist, reflection, allowed)
      Accessing hidden method Llibcore/io/Memory;-&gt;pokeByteArray(J[BII)V (greylist, reflection, allowed)
      Accessing hidden method Llibcore/io/Memory;-&gt;peekByteArray(J[BII)V (greylist, reflection, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, linking, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;arrayIndexScale(Ljava/lang/Class;)I (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
      Accessing hidden field Ljava/nio/Buffer;-&gt;address:J (greylist, reflection, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;getInt(Ljava/lang/Object;J)I (greylist, reflection, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;putInt(Ljava/lang/Object;JI)V (greylist, reflection, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;putLong(Ljava/lang/Object;JJ)V (greylist, reflection, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, reflection, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, reflection, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;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;-&gt;pathList:Ldalvik/system/DexPathList; (greylist, reflection, allowed)
      Accessing hidden field Ldalvik/system/DexPathList;-&gt;nativeLibraryDirectories:Ljava/util/List; (greylist, reflection, allowed)
      Accessing hidden field Ldalvik/system/DexPathList;-&gt;systemNativeLibraryDirectories:Ljava/util/List; (greylist, reflection, allowed)
      Accessing hidden field Ldalvik/system/DexPathList;-&gt;nativeLibraryPathElements:[Ldalvik/system/DexPathList$NativeLibraryElement; (greylist, reflection, allowed)
      Accessing hidden method Ldalvik/system/DexPathList;-&gt;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;-&gt;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;-&gt;putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
      Accessing hidden method Lsun/misc/Unsafe;-&gt;putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;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;-&gt;getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
  W/le.do_i_need_i: Accessing hidden method Lsun/misc/Unsafe;-&gt;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.&lt;init&gt;(Socket.java:446)
          at java.net.Socket.&lt;init&gt;(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;-&gt;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.&lt;init&gt;(Socket.java:446)
          at java.net.Socket.&lt;init&gt;(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.&lt;init&gt;(Socket.java:446)
          at java.net.Socket.&lt;init&gt;(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;-&gt;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.&lt;init&gt;(Socket.java:446)
          at java.net.Socket.&lt;init&gt;(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;-&gt;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.&lt;init&gt;(Socket.java:446)
          at java.net.Socket.&lt;init&gt;(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;-&gt;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.&lt;init&gt;(Socket.java:446)
          at java.net.Socket.&lt;init&gt;(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;-&gt;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.&lt;init&gt;(Socket.java:446)
          at java.net.Socket.&lt;init&gt;(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)
      }.
  </code></pre>
  <p>I have checked the device has internet connectivity and able to access to Internet, also, it work fine on the Firebase Authentication.
  My code:</p>
  <pre><code>  FirebaseFirestore db = FirebaseFirestore.getInstance();
          Map&lt;String,Object&gt; products = new HashMap&lt;&gt;();
          products.put(&quot;title&quot;,productTitle);
          products.put(&quot;price&quot;,productPrice);
          products.put(&quot;webpage&quot;,productWebPage);
          products.put(&quot;userId&quot;,&quot;asa&quot;);
          db.collection(&quot;products&quot;).add(products).addOnSuccessListener(new OnSuccessListener&lt;DocumentReference&gt;() {
              @Override
              public void onSuccess(DocumentReference documentReference) {
                  Toast.makeText(c,&quot;Added&quot;, Toast.LENGTH_LONG).show();
              }
          }).addOnFailureListener(new OnFailureListener() {
              @Override
              public void onFailure(@NonNull Exception e) {
                  Toast.makeText(c,e.getMessage(), Toast.LENGTH_LONG).show();
              }
          });
  </code></pre>
  <p>*Currently, I have Firebase Authentication integrated in my environment (which is working fine at the moment).</p>
  <p>I have checked with Firebase documentation and follow those guidelines accordingly but the problem still persisted.</p>
  <p>Thanks.</p>