android - ParseTwitterUtils initialize throws NullPointerException -


i getting nullpointerexception calling

parsetwitterutils.initialize(twitter_consumer_key, twitter_consumer_secret); 

here stack trace

java.lang.runtimeexception: unable create application com.myapp.app.android.application: java.lang.nullpointerexception: attempt invoke virtual method 'java.io.file com.parse.parseplugins.getparsedir()' on null object reference             @ android.app.activitythread.handlebindapplication(activitythread.java:5015)             @ android.app.activitythread.access$1600(activitythread.java:172)             @ android.app.activitythread$h.handlemessage(activitythread.java:1482)             @ android.os.handler.dispatchmessage(handler.java:102)             @ android.os.looper.loop(looper.java:145)             @ android.app.activitythread.main(activitythread.java:5837)             @ java.lang.reflect.method.invoke(native method)             @ java.lang.reflect.method.invoke(method.java:372)             @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1388)             @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1183)      caused by: java.lang.nullpointerexception: attempt invoke virtual method 'java.io.file com.parse.parseplugins.getparsedir()' on null object reference             @ com.parse.parse.getparsedir(parse.java:313)             @ com.parse.parsecoreplugins.getcurrentusercontroller(parsecoreplugins.java:124)             @ com.parse.parseuser.getcurrentusercontroller(parseuser.java:56)             @ com.parse.parseuser.getcurrentuser(parseuser.java:892)             @ com.parse.parseuser.getcurrentuser(parseuser.java:879)             @ com.parse.parseuser.registerauthenticationprovider(parseuser.java:1125)             @ com.parse.parsetwitterutils.getauthenticationprovider(parsetwitterutils.java:20)             @ com.parse.parsetwitterutils.initialize(parsetwitterutils.java:50)             @ com.myapp.app.android.application.oncreate(application.java:42)             @ android.app.instrumentation.callapplicationoncreate(instrumentation.java:1020)             @ android.app.activitythread.handlebindapplication(activitythread.java:5012)             at android.app.activitythread.access$1600(activitythread.java:172)             at android.app.activitythread$h.handlemessage(activitythread.java:1482)             at android.os.handler.dispatchmessage(handler.java:102)             at android.os.looper.loop(looper.java:145)             at android.app.activitythread.main(activitythread.java:5837)             at java.lang.reflect.method.invoke(native method)             at java.lang.reflect.method.invoke(method.java:372)             at com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1388)             at com.android.internal.os.zygoteinit.main(zygoteinit.java:1183) 

my app used work before added line parsetwitterutils.initialize(...). here oncreate method of application class

public void oncreate(){     super.oncreate();     registerdatabasetables();     parsetwitterutils.initialize(twitter_consumer_key, twitter_consumer_secret);     parse.enablelocaldatastore(this);     parse.initialize(this, parse_application_id, parse_client_key); } 

unfortunately instructions on parse.com not this, have initialize parse before initialize twitter. not obvious since required before initialize parse. anyway change code this:

public void oncreate(){     super.oncreate();     registerdatabasetables();     parse.enablelocaldatastore(this);     parse.initialize(this, parse_application_id, parse_client_key);     parsetwitterutils.initialize(twitter_consumer_key, twitter_consumer_secret); } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -