Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null pointer from using RestAdapter #101

Open
jjhesk opened this issue Jul 22, 2016 · 1 comment
Open

null pointer from using RestAdapter #101

jjhesk opened this issue Jul 22, 2016 · 1 comment

Comments

@jjhesk
Copy link

jjhesk commented Jul 22, 2016

I got this when I start using the RestAdapter at oncreate in the activity.

07-22 17:10:27.423 14026-14026/tileview.demo E/AndroidRuntime: FATAL EXCEPTION: main
Process: tileview.demo, PID: 14026
java.lang.RuntimeException: Unable to start activity ComponentInfo{****}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.loopj.android.http.AsyncHttpClient.addHeader(java.lang.String, java.lang.String)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.loopj.android.http.AsyncHttpClient.addHeader(java.lang.String, java.lang.String)' on a null object reference
at com.strongloop.android.loopback.RestAdapter.setAccessToken(RestAdapter.java:32)
at com.strongloop.android.loopback.RestAdapter.(RestAdapter.java:27)
at com.galleria.loopbackdataclip.GalleriaLB.init(GalleriaLB.java:101)
at com.galleria.loopbackdataclip.GalleriaLB.getInstance(GalleriaLB.java:57)
at tileview.demo.NetworkMap.onCreate(NetworkMap.java:38)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5422) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

@serjooo
Copy link

serjooo commented Mar 4, 2017

How are you creating the RestAdapter can we see some code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants