I am trying to write data to firestore, but I am getting the following error:
java.lang.NoSuchMethodError com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;
pom.xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>5.9.0</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava-jdk5</artifactId>
</exclusion>
</exclusions>
</dependency>
When this instruction is executed the exception is thrown:
collRef = db.collection("country");
Map<String, Object> docData = new HashMap<>();
docData.put("CODE", "1");
docData.put("NAME", "UNITED STATES");
docRef = collRef.document("1");
ApiFuture<WriteResult> result = docRef.set(docData);// In this line
Note: It is the only version of firebase-admin that does not get the exception java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
Help, I have spent many days and I can not solve
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…