Reputation: 453
I am trying to figure out how to fetch Gmail Contacts
in my app
.
On implementing the code in the link https://developers.google.com/google-apps/contacts/v3/#updating_contacts
I am getting the exception specified below:-
But i am getting Exception that is Caused by: java.lang.NullPointerException
com.google.gdata.client.http.HttpGDataRequest.isOAuthProxyErrorResponse
And using the example code on http://androidwarzone.blogspot.in/2011/07/android-oauth-full-example-with-source.html
I am getting the exception as :-
03-07 17:05:21.601: E/AndroidRuntime(18754): java.lang.NoClassDefFoundError: Failed resolution of: Loauth/signpost/commonshttp/CommonsHttpOAuthConsumer;
03-07 17:05:21.601: E/AndroidRuntime(18754): at com.netcomps.oauth_example.RequestTokenActivity.onCreate(RequestTokenActivity.java:32)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.Activity.performCreate(Activity.java:5990)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread.access$800(ActivityThread.java:151)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.os.Handler.dispatchMessage(Handler.java:102)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.os.Looper.loop(Looper.java:135)
03-07 17:05:21.601: E/AndroidRuntime(18754): at android.app.ActivityThread.main(ActivityThread.java:5254)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.reflect.Method.invoke(Native Method)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.reflect.Method.invoke(Method.java:372)
03-07 17:05:21.601: E/AndroidRuntime(18754): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
03-07 17:05:21.601: E/AndroidRuntime(18754): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
03-07 17:05:21.601: E/AndroidRuntime(18754): Caused by: java.lang.ClassNotFoundException: Didn't find class "oauth.signpost.commonshttp.CommonsHttpOAuthConsumer" on path: DexPathList[[zip file "/data/app/com.netcomps.oauth_example-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
03-07 17:05:21.601: E/AndroidRuntime(18754): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
03-07 17:05:21.601: E/AndroidRuntime(18754): ... 14 more
03-07 17:05:21.601: E/AndroidRuntime(18754): Suppressed: java.lang.ClassNotFoundException: oauth.signpost.commonshttp.CommonsHttpOAuthConsumer
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.Class.classForName(Native Method)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
03-07 17:05:21.601: E/AndroidRuntime(18754): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
03-07 17:05:21.601: E/AndroidRuntime(18754): ... 15 more
03-07 17:05:21.601: E/AndroidRuntime(18754): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Could you please help me out.
Any help will deeply appriciated.
Upvotes: 2
Views: 657
Reputation: 453
Finally, i got the solution to fetch the Google/Gmail contacts.The following link is very suitable answer to my question.
https://tush.wordpress.com/2014/07/15/android-google-contact-api-3-0-example/
This helps me a lot.
Updated Answer:
As Google is blocking the oAuth from webView so this link help you to fetch gmail contacts https://codelabs.developers.google.com/codelabs/appauth-android-codelab/#2
Upvotes: 3