Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
463 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

question from:https://stackoverflow.com/questions/65602767/firebase-admin-java-lang-nosuchmethoderror-com-google-common-util-concurrent-mor

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

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...