When I am using Gmail API ,I am getting java.lang.NoClassDefFoundError: com.google.gson.stream.JsonReader

我的未来我决定 提交于 2020-01-16 01:17:21

问题


I am following Google Developer's Doc .I have included all mentioned jars but at runtime I getting this..

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)

The line where I am getting this error

ListLabelsResponse listResponse =
                mActivity.mService.users().labels().list(user).execute();

来源:https://stackoverflow.com/questions/32665608/when-i-am-using-gmail-api-i-am-getting-java-lang-noclassdeffounderror-com-goog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!