NoSuchMethod error on Google App Engine - java

My Google App Engine server runs:
The Firebase Admin SDK
Google Cloud Endpoints v2
After updating to Endpoints v2 recently (unsure if related), I have been getting this error on the server while my mobile app:
com.google.api.server.spi.SystemService invokeServiceMethod: exception occurred while calling backend method
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
at com.google.firebase.FirebaseApp.checkNotDeleted(FirebaseApp.java:314)
at com.google.firebase.FirebaseApp.getOptions(FirebaseApp.java:260)
at com.google.firebase.auth.FirebaseAuth.<init>(FirebaseAuth.java:74)
at com.google.firebase.auth.FirebaseAuth.<init>(FirebaseAuth.java:61)
at com.google.firebase.auth.FirebaseAuth.<init>(FirebaseAuth.java:52)
at com.google.firebase.auth.FirebaseAuth$FirebaseAuthService.<init>(FirebaseAuth.java:316)
at com.google.firebase.auth.FirebaseAuth.getInstance(FirebaseAuth.java:98)
at com.google.firebase.auth.FirebaseAuth.getInstance(FirebaseAuth.java:85)
at com.project.apis.UserAPI.verifyUserIDToken(MyAPI.java:100)
Can anyone advise? Other reports have suggested updating the Guava dependency in my pom.xml, but I am not even using Guava:
https://github.com/SeleniumHQ/selenium/issues/3880
https://github.com/SeleniumHQ/selenium/issues/3540

This happens when there are 2 incompatible versions of guava in the classpath. Firebase uses one version (v20.0), and the Google App Engine libraries use an older version (v18.0 I believe). You can check the dependency tree using the mvn dependency:tree command, and then add an exclusion rule to the older version.
https://github.com/firebase/firebase-admin-java/issues/50
NoSuchMethodError: While integrating Firebase with app engine app

Related

Google App Engine SDK deprecation effecting my Framework application

I have application which is developed in Play framework 1.x and running on Google app engine Standard Environment.
And below is the way I am deploying the application GAE.
Command- play gae:deploy
But this command internally calling "appcfg" from GAE Cloud SDK.
So now I have to change my deployment procedure.I have tried to deploy using Cloud SDK as recommended by Google Document.The base command which - "gcloud app deploy".
I have checked the Google Cloud documentation And found that they are recommend to use Java11 for GAE standard Environment with app.yaml file.
But I want to use Java8 only as of now for GAE standard env.
But while deploying its giving warning as below-
WARNING: Automatic app detection is deprecated and will soon be removed. As an a
lternative, create an app.yaml file yourself using the directions at https://clo
ud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml
(App Engine Flexible Environment) or https://cloud.google.com/appengine/docs/sta
ndard/python/config/appref (App Engine Standard Environment) under the tab for y
our language.
Deployment to Google App Engine requires an app.yaml file. This
command will run gcloud beta app gen-config to generate an app.yaml
file for you in the current directory (if the current directory does
not contain an App Engine service, please answer "no").
If I have to build app.yaml file for my java based GAE standard application what will be the structure for that?
If app.yaml file is not possible for java8 GAE application what will be the structure of appengine-web.xml for deploying this application using command
"gcloud app deploy"
There is one more alternative is ,I should migrate the application maven based application. But right now I don't want to migrate to maven tool.
They explain how to migrate here, basically get the Cloud SDK and instead of appcfg command, you’ll have to be using gcloud command.
To your questions:
1 - An app.yaml is not required for Java8 Standard Environment
2 - To deploy a Java8 app with maven to GAE Standard you will use the command mvn appengine:deploy
3 - This documentation explains how the migration to CloudSDK based Maven plugin. And this one explains the migration to Cloud SDK based Gradle plugin

java lang Null Pointerexception After update Google Service

When I added Library in my Project And Library has a Google service
Old plugin version is 4.1.0 of Google Service in my Library
Verify gradle can configure itself, project builds
Set plugin version to 4.2.0 of Google Service
The only visible message is Cause: java.lang.NullPointerException
Gradle Version is 3.3.1
Please tell me what can I do in this situation ?
LogCat
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warningsCONFIGURE FAILED in 11s
ERROR: Cause: java.lang.NullPointerException
if you want to out from this error
so please backward of your google service version from 4.2.0 to 4.1.0 this is jugad not a solution
Error is gone......:)

ROS ERROR: Gradle 'android_10' project refresh failed

Error:Unsupported method: BaseConfig.getApplicationIdSuffix().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
I am trying to use ROSJava in Android Studio 3.0.1 but following the installation instructions given here leads to this error in Android Studio. Please advise.
I managed to solve the issue by using Android Studio 2.x.x instead of the newer 3.x.x version.

Conflict in Maven Dependencies not getting resolved

I am working with Google cloud APIs for Google Speech and Google Natural Language Processing. The version i am using for both is as follows:
google-cloud-speech: 0.13.0-alpha
google-cloud-language: 0.9.4-alpha
And both of them uses the google-gax api as an internal dependency. While speech api using the gax version 0.10.0, the language api uses the 0.1.4.
In the pom, i have the depedency scope as provided. So for the reason, i am providing the jars in the lib folder of the server.
But the issues is with the gax api. The problem is:
When i provide the gax version 0.10.0, the speech api works but language api does not work.
If the gax version 0.1.4 is provided, then language api works but the speech apis doesn't works.
And if both the version are provided, then only speech api works.
Any suggestions to resolve the issue? I have tried everything viz cleaning the project, updating the maven, re-deploy the project, delete all maven dependecy and rebuild. But did not get the problem resolved.
Changing the google-cloud-language worked well. Now updated the language version to
google-cloud-language-0.13.0-alpha
and everything worked smoothly. The reason being this version uses the gax-0.10.0 and thus resolving the conflicts.

Unable to load class 'com.google.gson.JsonObject'

I am trying to include firebase SDK in my Android Studio Project. But it giving me an error. I am using latest JDK version (1.7.0_71) and it is asking for upgrading higher version to (1.7.0_67).
I need help for basic firebase setup SDK on android. I tried to setup it by the reference of following link: https://firebase.google.com/docs/android/setup#add_the_sdk.
I am getting following error: Please check attached screenshot
I had the same problem trying to GCM to an old android project.
The solution for me was to also add
classpath 'com.android.tools.build:gradle:2.1.2'
to the top-level build file dependencies, just before classpath 'com.google.gms:google-services:3.0.0'. For the old android project, this dependency only existed in the module-level build file.
Make sure you are using Android Studio 1.5 or above. Just saw a guy who had the same issue and he was using android studio 1.0.1
Updating the Android Studio will fix it for you. Also check other pre-requisites.
Prerequisites from official documentation are as follows:
A device running Android 2.3 (Gingerbread) or newer, and Google Play services 9.2.1 or newer
The Google Play services SDK from the Android SDK Manager
Android Studio 1.5 or higher
An Android Studio project and its package name
First of all complete all the steps mentioned in a link you had followed for Firebase
And note that it requires active internet connection so please check internet connection and add both project and app level dependencies as per suggested in link of Firebase you had used in question
Also it is best to use JDK version 1.8 and above because oracle officialy ended support for those versions. If you are working with Firebase Api which is quiet new so i would highly recommend as it is also recommended by most professionals including developers at Google.Or if you want to go with JDK 1.7 then update it to latest Jdk 7u80 or 7u79 at least because it has least issues comparing to older versions.
The best solution is use JDK version 1.8 and follow all the steps in link https://firebase.google.com/docs/android/setup#add_the_sdk
Ensure that you have the google-services.json file, with the client id: <effective package name>, in the app directory. This you download from the Firebase console when you add an app.

Categories