Google应用引擎中的Firebase在初始化时抛出noMethodFound错误 [英] Firebase in Google app engine throwing noMethodFound error while initialization
问题描述
<依赖关系>我试图在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)
问题:
-
转到 http://search.maven.org/#search%7Cga%7C1%7Cgoogle-api-client 并查找最新版本的com.google.api客户端API。
-
添加对您的项目的依赖关系
<依赖性>
< groupId> com.google.api-client< / groupId>
< artifactId> google-api-client-assembly< / artifactId>
<版本>上一版本< / version>
< /依赖>
Go to http://search.maven.org/#search%7Cga%7C1%7Cgoogle-api-client and find the last version of com.google.api-client API.
Add the dependency on you project
<dependency> <groupId>com.google.api-client</groupId> <artifactId>google-api-client-assembly</artifactId> <version>last version </version> </dependency>
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:
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屋!