Google应用引擎中的Firebase在初始化时抛出noMethodFound错误 [英] Firebase in Google app engine throwing noMethodFound error while initialization

查看:204
本文介绍了Google应用引擎中的Firebase在初始化时抛出noMethodFound错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <依赖关系>我试图在Google appengine网络应用程序中初始化firebase,并使用maven进行依赖。 
< groupId> com.google.firebase< / groupId>
< artifactId> firebase-server-sdk< / artifactId>
< version> [3.0.0,)< / version>
< /依赖>

获取错误

  java.lang.NoSuchMethodError:com.google.api.client.googleapis.auth.oauth2.GoogleCredential.fromStream(....)
,位于com.google.firebase.FirebaseOptions $ Builder.setServiceAccount (FirebaseOptions.java:77)


解决方案

问题:


  1. 转到 http://search.maven.org/#search%7Cga%7C1%7Cgoogle-api-client 并查找最新版本的com.google.api客户端API。


  2. 添加对您的项目的依赖关系

     <依赖性> 
    < groupId> com.google.api-client< / groupId>
    < artifactId> google-api-client-assembly< / artifactId>
    <版本>上一版本< / version>
    < /依赖>




  3. glassfish服务器,所以我下载最新版本的com.google.api-client的jar文件,将它添加到Netbeans库和glassfish库,然后我编译该项目并重新启动glassfish。

    I am trying to initialize firebase in Google appengine web app and using maven for dependencies.

    <dependency>
            <groupId>com.google.firebase</groupId>
            <artifactId>firebase-server-sdk</artifactId>
            <version>[3.0.0,)</version>
        </dependency>
    

    Getting error

    java.lang.NoSuchMethodError: com.google.api.client.googleapis.auth.oauth2.GoogleCredential.fromStream(....)
    at com.google.firebase.FirebaseOptions$Builder.setServiceAccount(FirebaseOptions.java:77)
    

    解决方案

    How to solve this issue:

    1. Go to http://search.maven.org/#search%7Cga%7C1%7Cgoogle-api-client and find the last version of com.google.api-client API.

    2. Add the dependency on you project

      <dependency>
      <groupId>com.google.api-client</groupId>
      <artifactId>google-api-client-assembly</artifactId>
      <version>last version </version>
      </dependency>
      

    I do this on EJB project using netbeans and glassfish server, so I download the jar file of the last version com.google.api-client add it on Netbeans Libraries and glassfish libraries, then I compile the project and restart glassfish.

    这篇关于Google应用引擎中的Firebase在初始化时抛出noMethodFound错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆