0

I have an app-engine connected android app. The server is in java. I am testing the Login web service of the backend. Where the code calls the endpoint to send the login information, I get an exception. I am including the entire stack trace. But the root cause seems to be LoginActivity.java:262:

service.registerUser(request).execute();//service is endpoint

There is nothing particular about this login. It's just a POST with data. I don't know how to interpret the error line

Caused by: java.lang.VerifyError: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler

I think it's what I need to understand.

Anyway, here is the entire trace:

04-03 11:48:50.028: E/AndroidRuntime(9385): FATAL EXCEPTION: AsyncTask #1
04-03 11:48:50.028: E/AndroidRuntime(9385): java.lang.RuntimeException: An error occured while executing doInBackground()
04-03 11:48:50.028: E/AndroidRuntime(9385):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at java.lang.Thread.run(Thread.java:1096)
04-03 11:48:50.028: E/AndroidRuntime(9385): Caused by: java.lang.VerifyError: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler
04-03 11:48:50.028: E/AndroidRuntime(9385):     at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.initialize(GoogleAccountCredential.java:124)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:93)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:292)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:412)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:463)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at com.example.learning.LoginActivity$UserLoginTask.doInBackground(LoginActivity.java:262)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at com.example.learning.LoginActivity$UserLoginTask.doInBackground(LoginActivity.java:1)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
04-03 11:48:50.028: E/AndroidRuntime(9385):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
04-03 11:48:50.028: E/AndroidRuntime(9385):     ... 4 more
04-03 11:48:50.160: W/IInputConnectionWrapper(9385): showStatusIcon on inactive InputConnection

EDIT:

To set up the credentials, I just follow the template:

public static GameApp getService(Context context) {
        GoogleAccountCredential credential = GoogleAccountCredential.usingAudience(context, StateValues.AUDIENCE);
        GameApp.Builder builder = new GameApp.Builder(
            AndroidHttp.newCompatibleTransport(),
            new GsonFactory(),
            credential);
        GameApp service = builder.build();
        return service;
    }
learner
  • 11,490
  • 26
  • 97
  • 169
  • 1
    Can you show the code where you set up your GoogleAccountCredential? – aez Apr 03 '13 at 19:58
  • 1
    Can you list the jars that are in your libs/ folder? It looks like you may have different versions of the same classes on your classpath. You're running in the emulator, right? – Rajeev Dayal Apr 03 '13 at 20:43
  • 1
    Curious that you're getting a `VerifyError`. Are there any errors above that exception in the log? Any `VFY` complaints when the app first starts? – fadden Apr 03 '13 at 20:44

1 Answers1

2

It looks like the problem was the google-play-service.jar. I had been adding it through the build path. Now I added it manually into the libs folder, and that problem went away. Thanks everyone for commenting. Upvote to all.

learner
  • 11,490
  • 26
  • 97
  • 169