开发者

Facebook Errors on itegrating facebook sdk in android app

开发者 https://www.devze.com 2023-04-13 04:29 出处:网络
I integrated facebook in my app. The errors i getting in in two cases: when facebook.apk is installed in emulator.

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.jav开发者_如何学编程a: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

Facebook Errors on itegrating facebook sdk in android app

* 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号