title: Firestore ExceptionInInitializerError at database modification
body: <p>i tried to use Firestore for my Android application project, but when i run this code, which is basically the documentation code of Firestore:</p>
  <pre><code>protected Integer sendAllToBack () {
      try {
          FirebaseFirestore db = FirebaseFirestore.getInstance();
          Map&lt;String, Object&gt; data = new HashMap&lt;&gt;();
          data.put(&quot;toto&quot;, &quot;tata&quot;);
          db.collection(&quot;users&quot;).add(data);
      } catch (Exception e) {
          e.printStackTrace();
          return 1;
      }
      return 0;
  }
  </code></pre>
  <p>I get this error:</p>
  <pre><code>    Process: xxxxxxxxxxxxxx, PID: 14497
      java.lang.ExceptionInInitializerError
          at com.google.firestore.v1.MapValue.newBuilder(com.google.firebase:firebase-firestore@@21.4.3:232)
          at com.google.firebase.firestore.UserDataReader.parseMap(com.google.firebase:firebase-firestore@@21.4.3:290)
          at com.google.firebase.firestore.UserDataReader.parseData(com.google.firebase:firebase-firestore@@21.4.3:251)
          at com.google.firebase.firestore.UserDataReader.convertAndParseDocumentData(com.google.firebase:firebase-firestore@@21.4.3:232)
          at com.google.firebase.firestore.UserDataReader.parseMergeData(com.google.firebase:firebase-firestore@@21.4.3:87)
          at com.google.firebase.firestore.DocumentReference.set(com.google.firebase:firebase-firestore@@21.4.3:165)
          at xxxxxxxxxxxxx.MainActivity.sendAllToBack(MainActivity.java:298)
          at xxxxxxxxxxxxx.MainActivity.onDestroy(MainActivity.java:317)
          at android.app.Activity.performDestroy(Activity.java:8078)
          at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1353)
          at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5057)
          at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5101)
          at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
          at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2123)
          at android.os.Handler.dispatchMessage(Handler.java:107)
          at android.os.Looper.loop(Looper.java:214)
          at android.app.ActivityThread.main(ActivityThread.java:7710)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
       Caused by: java.lang.RuntimeException: Unable to get message info for com.google.firestore.v1.MapValue
          at com.google.protobuf.GeneratedMessageInfoFactory.messageInfoFor(GeneratedMessageInfoFactory.java:62)
          at com.google.protobuf.ManifestSchemaFactory$CompositeMessageInfoFactory.messageInfoFor(ManifestSchemaFactory.java:143)
          at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:55)
          at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:93)
          at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:107)
          at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:171)
          at com.google.firestore.v1.MapValue.&lt;clinit&gt;(com.google.firebase:firebase-firestore@@21.4.3:490)
          at com.google.firestore.v1.MapValue.newBuilder(com.google.firebase:firebase-firestore@@21.4.3:232) 
          at com.google.firebase.firestore.UserDataReader.parseMap(com.google.firebase:firebase-firestore@@21.4.3:290) 
          at com.google.firebase.firestore.UserDataReader.parseData(com.google.firebase:firebase-firestore@@21.4.3:251) 
          at com.google.firebase.firestore.UserDataReader.convertAndParseDocumentData(com.google.firebase:firebase-firestore@@21.4.3:232) 
          at com.google.firebase.firestore.UserDataReader.parseMergeData(com.google.firebase:firebase-firestore@@21.4.3:87) 
          at com.google.firebase.firestore.DocumentReference.set(com.google.firebase:firebase-firestore@@21.4.3:165) 
          at com.bouygues.bysafe.MainActivity.sendAllToBack(MainActivity.java:298) 
          at com.bouygues.bysafe.MainActivity.onDestroy(MainActivity.java:317) 
          at android.app.Activity.performDestroy(Activity.java:8078) 
          at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1353) 
          at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5057) 
          at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5101) 
          at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44) 
          at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) 
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) 
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2123) 
          at android.os.Handler.dispatchMessage(Handler.java:107) 
          at android.os.Looper.loop(Looper.java:214) 
          at android.app.ActivityThread.main(ActivityThread.java:7710) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 
       Caused by: java.lang.UnsupportedOperationException
          at com.google.firestore.v1.MapValue.dynamicMethod(com.google.firebase:firebase-firestore@@21.4.3:482)
          at com.google.protobuf.GeneratedMessageLite.dynamicMethod(GeneratedMessageLite.java:252)
          at com.google.protobuf.GeneratedMessageLite.buildMessageInfo(GeneratedMessageLite.java:280)
          at com.google.protobuf.GeneratedMessageInfoFactory.messageInfoFor(GeneratedMessageInfoFactory.java:60)
          at com.google.protobuf.ManifestSchemaFactory$CompositeMessageInfoFactory.messageInfoFor(ManifestSchemaFactory.java:143) 
          at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:55) 
          at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:93) 
          at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:107) 
          at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:171) 
          at com.google.firestore.v1.MapValue.&lt;clinit&gt;(com.google.firebase:firebase-firestore@@21.4.3:490) 
          at com.google.firestore.v1.MapValue.newBuilder(com.google.firebase:firebase-firestore@@21.4.3:232) 
          at com.google.firebase.firestore.UserDataReader.parseMap(com.google.firebase:firebase-firestore@@21.4.3:290) 
          at com.google.firebase.firestore.UserDataReader.parseData(com.google.firebase:firebase-firestore@@21.4.3:251) 
          at com.google.firebase.firestore.UserDataReader.convertAndParseDocumentData(com.google.firebase:firebase-firestore@@21.4.3:232) 
          at com.google.firebase.firestore.UserDataReader.parseMergeData(com.google.firebase:firebase-firestore@@21.4.3:87) 
          at com.google.firebase.firestore.DocumentReference.set(com.google.firebase:firebase-firestore@@21.4.3:165) 
          at com.bouygues.bysafe.MainActivity.sendAllToBack(MainActivity.java:298) 
          at com.bouygues.bysafe.MainActivity.onDestroy(MainActivity.java:317) 
          at android.app.Activity.performDestroy(Activity.java:8078) 
          at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1353) 
          at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5057) 
          at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5101) 
          at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44) 
          at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) 
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) 
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2123) 
          at android.os.Handler.dispatchMessage(Handler.java:107) 
          at android.os.Looper.loop(Looper.java:214) 
          at android.app.ActivityThread.main(ActivityThread.java:7710) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 
  </code></pre>
  <p>Has anyone any clue about what i may be doing wrong ?
  I tried with
  <code>db.collection(&quot;users&quot;).document(&quot;1&quot;).set(data, SetOptions.merge());</code>
  which is the code i wanted to run at the beginning and i had the exact issue.</p>
  <p>This code is in the MainActivity of my Android application, and i call it in the onDestroy method.</p>