我正在关注 Google Developer's Doc 。我已经包含了所有提到的 jar,但在运行时我得到了这个..
java.lang.RuntimeException: An error occured while executing doInBackground()
09-19 12:42:06.416: E/AndroidRuntime(14215): at android.os.AsyncTask$3.done(AsyncTask.java:300)
09-19 12:42:06.416: E/AndroidRuntime(14215): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
09-19 12:42:06.416: E/AndroidRuntime(14215): at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
09-19 12:42:06.416: E/AndroidRuntime(14215): at java.util.concurrent.FutureTask.run(FutureTask.java:242)
09-19 12:42:06.416: E/AndroidRuntime(14215): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
09-19 12:42:06.416: E/AndroidRuntime(14215): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
09-19 12:42:06.416: E/AndroidRuntime(14215): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
09-19 12:42:06.416: E/AndroidRuntime(14215): at java.lang.Thread.run(Thread.java:841)
09-19 12:42:06.416: E/AndroidRuntime(14215): Caused by: java.lang.NoClassDefFoundError: com.google.gson.stream.JsonReader
09-19 12:42:06.416: E/AndroidRuntime(14215): at com.google.api.client.json.gson.GsonFactory.createJsonParser(GsonFactory.java:86)
09-19 12:42:06.416: E/AndroidRuntime(14215): at com.google.api.client.json.gson.GsonFactory.createJsonParser(GsonFactory.java:76)
09-19 12:42:06.416: E/AndroidRuntime(14215): at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:85)
09-19 12:42:06.416: E/AndroidRuntime(14215): at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:81)
09-19 12:42:06.416: E/AndroidRuntime(14215): at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:459)
09-19 12:42:06.416: E/AndroidRuntime(14215): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
09-19 12:42:06.416: E/AndroidRuntime(14215): at com.example.gmailquickstart.ApiAsyncTask.getDataFromApi(ApiAsyncTask.java:73)
09-19 12:42:06.416: E/AndroidRuntime(14215): at com.example.gmailquickstart.ApiAsyncTask.doInBackground(ApiAsyncTask.java:39)
09-19 12:42:06.416: E/AndroidRuntime(14215): at com.example.gmailquickstart.ApiAsyncTask.doInBackground(ApiAsyncTask.java:1)
09-19 12:42:06.416: E/AndroidRuntime(14215): at android.os.AsyncTask$2.call(AsyncTask.java:288)
09-19 12:42:06.416: E/AndroidRuntime(14215): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
我收到此错误的行
ListLabelsResponse listResponse =
mActivity.mService.users().labels().list(user).execute();