Android - Facebook login causes onResume error only for first time -


i can connect facebook , friendlist. connections ok. when delete data of facebook(through settings->applications) , app's, login problem occurs. [sdk 3.5]

  1. launch app
  2. make facebook connection
  3. facebook asks username , password, enter them
  4. wait little
  5. it shows permission screen asks basic user info , error occurs:" application stop working unexpectedly. please try again (force close)"

when click force close, same error occurs again , again suddenly(while permission screen still behind). if can quick enough, click force close , allow permission, goes ok , can see friends. force close error means nothing? in log, there 3-4 of same fatal exception messages because each time click force close, error occurs again. error occurs when try application on phone(se xperia arc s, 2.3.3). when try on emulators, error doesn't occur. works without problem. (emulators 2.3.3 , 4.2)

    09-04 18:09:47.916 e/androidruntime(29511): fatal exception: main 09-04 18:09:47.916 e/androidruntime(29511): java.lang.runtimeexception: unable resume activity {com.ilanharitasi/com.facebook.loginactivity}: java.lang.nullpointerexception 09-04 18:09:47.916 e/androidruntime(29511): caused by: java.lang.nullpointerexception 09-04 18:09:47.916 e/androidruntime(29511):     ... 12 more 09-04 18:09:51.526 e/androidruntime(29538): fatal exception: main 09-04 18:09:51.526 e/androidruntime(29538): java.lang.runtimeexception: unable resume activity {com.ilanharitasi/com.facebook.loginactivity}: java.lang.nullpointerexception 09-04 18:09:51.526 e/androidruntime(29538): caused by: java.lang.nullpointerexception 09-04 18:09:51.526 e/androidruntime(29538):     ... 12 more 09-04 18:09:53.786 e/androidruntime(29547): fatal exception: main 09-04 18:09:53.786 e/androidruntime(29547): java.lang.runtimeexception: unable resume activity {com.ilanharitasi/com.facebook.loginactivity}: java.lang.nullpointerexception 09-04 18:09:53.786 e/androidruntime(29547): caused by: java.lang.nullpointerexception 09-04 18:09:53.786 e/androidruntime(29547):     ... 12 more 09-04 18:09:55.516 e/androidruntime(29557): fatal exception: main 09-04 18:09:55.516 e/androidruntime(29557): java.lang.runtimeexception: unable resume activity {com.ilanharitasi/com.facebook.loginactivity}: java.lang.nullpointerexception 09-04 18:09:55.516 e/androidruntime(29557): caused by: java.lang.nullpointerexception 09-04 18:09:55.516 e/androidruntime(29557):     ... 12 more 09-04 18:09:57.776 e/androidruntime(29564): fatal exception: main 09-04 18:09:57.776 e/androidruntime(29564): java.lang.runtimeexception: unable resume activity {com.ilanharitasi/com.facebook.loginactivity}: java.lang.nullpointerexception 09-04 18:09:57.776 e/androidruntime(29564): caused by: java.lang.nullpointerexception 09-04 18:09:57.776 e/androidruntime(29564):     ... 12 more 09-04 18:09:59.186 e/dalvikvm(29571): not find class 'dalvik.system.basedexclassloader', referenced method com.facebook.common.dextricks.systemclassloaderadder.a 09-04 18:09:59.586 e/dalvik-internals(29571): failed laddumpprofiles 09-04 18:09:59.586 e/dalvik-internals(29571): failed ladresetprofiles 09-04 18:09:59.586 e/dalvik-internals(29571): failed ladprintheaderinfo 09-04 18:09:59.936 e/androidruntime(29578): fatal exception: main 09-04 18:09:59.936 e/androidruntime(29578): java.lang.runtimeexception: unable resume activity {com.ilanharitasi/com.facebook.loginactivity}: java.lang.nullpointerexception 09-04 18:09:59.936 e/androidruntime(29578): caused by: java.lang.nullpointerexception 09-04 18:09:59.936 e/androidruntime(29578):     ... 12 more 09-04 18:10:02.006 e/androidruntime(29585): fatal exception: main 09-04 18:10:02.006 e/androidruntime(29585): java.lang.runtimeexception: unable resume activity {com.ilanharitasi/com.facebook.loginactivity}: java.lang.nullpointerexception 09-04 18:10:02.006 e/androidruntime(29585): caused by: java.lang.nullpointerexception 09-04 18:10:02.006 e/androidruntime(29585):     ... 12 more 09-04 18:10:04.566 e/onresume(29605): onresume worked 09-04 18:10:04.636 e/statem  (29605): opening 09-04 18:10:05.186 e/onresume(29605): onresume worked 

after first connection, can find friends without error. happens after connect facebook first time , asks username , password(and clicking login)

@override   public void oncreate(bundle savedinstancestate) {      super.oncreate(savedinstancestate);     uihelper = new uilifecyclehelper(this, callback);     uihelper.oncreate(savedinstancestate);      setcontentview(r.layout.activity_fb_findfriends);     linearlayout v = (linearlayout) findviewbyid(r.id.fb_app_users);     opensession(v);    }  public void opensession(view v){         // start facebook login         session.openactivesession(this, true, callback);      }  @override   protected void onresume() {       super.onresume();       uihelper.onresume();       log.e("onresume", "onresume çalıştı");   }  private void requestmyappfacebookfriends(session session) {         request friendsrequest = createrequest(session);         friendsrequest.setcallback(new request.callback() {              @override             public void oncompleted(response response) {                  list<graphuser> friends = getresults(response);                 //display friends             }         });     friendsrequest.executeasync(); } 

also couldn't understand null log output.

update! found line error occurs. inside com.facebook.authorizationclient.java line 135

void startorcontinueauth(authorizationrequest request) {         if (appeventslogger == null || appeventslogger.getapplicationid() != request.getapplicationid()) {             log.e("hata!", "boom");             appeventslogger = appeventslogger.newlogger(context, request.getapplicationid());         } 

and startorcontinueauth method fired in com.facebook.loginactivity

@override public void onresume() {     super.onresume();      // if calling package null, means callee started     // launchmode of singleinstance. unfortunately, android not allow result     // set when callee singleinstance, log error , return.     if (callingpackage == null) {         log.e(tag, "aheyy"+null_calling_pkg_error_msg);         finish();         return;     }      authorizationclient.startorcontinueauth(request); }         if (getinprogress()) {             continueauth();         } else {             authorize(request);         }     } 

update 2!

  • i got confused. simplified application basic openactivesession() method. crashes
  • i tried sample application of facebook, friendpicker , crash same log error output.
  • tried on emulator, works when rotate screen when authorization screen shows up(cancel-allow), same error occurs(unable onresume blah blah...) getting same error on facebook's sample application weird

i don't believe issue app. people have been reporting bug , answered similar question here. facebook released new version of sdk yesterday fixing onresume npe crash in authorizationclient. see if upgrading fixes issue.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -