up vote2down votefavorite 
<https://stackoverflow.com/questions/48045808/initializing-firebase-admin-in-app-engine-standard-java#>
2

I'm trying to use Firebase Auth in App engine standard Java to verify 
tokens from Android.

However, when I try to initialize Firebase admin, I get an Exception.

here is the exception:

java.lang.NoSuchMethodError: 
com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
at com.google.firebase.FirebaseApp.checkNotDeleted (FirebaseApp.java:352)
at com.google.firebase.FirebaseApp.getOptions (FirebaseApp.java:267)
at com.google.firebase.FirebaseApp$TokenRefresher.<init> (FirebaseApp.java:434)
at com.google.firebase.FirebaseApp$TokenRefresher$Factory.create 
(FirebaseApp.java:535)
at com.google.firebase.FirebaseApp.<init> (FirebaseApp.java:113)
at com.google.firebase.FirebaseApp.initializeApp (FirebaseApp.java:201)
at com.google.firebase.FirebaseApp.initializeApp (FirebaseApp.java:188)
at com.google.firebase.FirebaseApp.initializeApp (FirebaseApp.java:175)

Most likely, because of conflict in Guava versions

here is my gradle:

dependencies {
    appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.60'
    compile 'com.google.appengine.tools:appengine-gcs-client:0.7'
    compile ('com.google.firebase:firebase-admin:5.7.0') {
        exclude group: 'com.google.guava'
    }
    compile 'com.google.guava:guava:23.0'
    compile 'javax.servlet:servlet-api:2.5'}

Here is the code:

InputStream in = filterConfig.getServletContext()
            .getResourceAsStream("/WEB-INF/PRIVATE_KEY_JSON.json");
FirebaseOptions options = null;try {
     options = new FirebaseOptions.Builder()
            .setCredentials(GoogleCredentials.fromStream(in))
            .build();} catch (IOException e) {
    e.printStackTrace();}FirebaseApp.initializeApp(options);

java <https://stackoverflow.com/questions/tagged/java> google-app-engine 
<https://stackoverflow.com/questions/tagged/google-app-engine> 
firebase-admin <https://stackoverflow.com/questions/tagged/firebase-admin>

https://stackoverflow.com/questions/48045808/initializing-firebase-admin-in-app-engine-standard-java

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/6540c236-c0c6-4194-adf1-52ddb4aa154d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appengine]... Zeyad Almajed
    • [google-appen... 'George (Cloud Platform Support)' via Google App Engine
      • [google-a... Zeyad Almajed
        • [goog... 'George (Cloud Platform Support)' via Google App Engine
          • [... Zeyad Almajed
            • ... 'George (Cloud Platform Support)' via Google App Engine
              • ... Zeyad Almajed
                • ... 'George (Cloud Platform Support)' via Google App Engine

Reply via email to