简体   繁体   中英

Facebook Errors on itegrating facebook sdk in android app

I integrated facebook in my app. The errors i getting in in two cases:

  1. when facebook.apk is installed in emulator. errors: A page comes up saying error code 100 invalid parameters and then if i again press ok button then my app getting force close with nullpointerexception.

2.when facebook.apk is not installed in emulator. errors: Although login page comes up but when i login getting Force close

Now i also try Example code come with facebook sdk. i put my appId in example app. Now while running the example app login occur after that when i click on post wall the post wall page comes up and suddenly app goes disappear No ERROR in logcat.

I am doing this because my app is identical to example app provided by facebook. (i copy paste the code from example app to my app).

Locat : 10-14 16:30:02.176: ERROR/AndroidRuntime(218): Uncaught handler: thread main

  exiting  due to uncaught exception
  10-14 16:30:02.226: ERROR/AndroidRuntime(218): java.lang.NullPointerException
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at       com.android.myapp.MyActivity$SampleAuthListener.onAuthSucceed(MyActivity.java:280)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at     com.android.myapp.SessionEvents.onLoginSuccess(SessionEvents.java:78)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at com.android.myapp.LoginButton$LoginDialogListener.onComplete(LoginButton.java:95)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at com.facebook.android.Facebook$1.onComplete(Facebook.java:308)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at com.facebook.android.FbDialog$FbWebViewClient.shouldOverrideUrlLoading(FbDialog.java:133)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at android.webkit.CallbackProxy.uiOverrideUrlLoading(CallbackProxy.java:193)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:304)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at android.os.Handler.dispatchMessage(Handler.java:99)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at android.os.Looper.loop(Looper.java:123)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at android.app.ActivityThread.main(ActivityThread.java:4363)
   10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at java.lang.reflect.Method.invokeNative(Native Method)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at java.lang.reflect.Method.invoke(Method.java:521)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
  10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
   10-14 16:30:02.226: ERROR/AndroidRuntime(218):     at dalvik.system.NativeStart.main(Native Method)

any help to solve this problem any suggestion are most welcome...

EDIT I tried with an another example similarly put my appId but same error is occurring this example is taken from here

在此处输入图片说明

* I think problem is not in the code but in the app page.*

EDIT NOTE I tried same application 20 or 25 days ago and it was working fine

Seems that problem in the Code you are using. Better change you facebook code recommended by Facebook team :

You need to Download code from here : Facebook in Github .

Then check this page for Integrating Facebook in you App : Guide To Integrate you App in Android .

If you need to post on the user's wall check this link :

Post in Facebook wall without Dialog

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM