Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
545 views
in Technique[技术] by (71.8m points)

Firebase-admin java.lang.NoSuchMethodError com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...