- Home /
Facebook SDK - FB.Init throws AuthTokenNullException on Android
Hiya,
I'm having problem with official Facebook SDK for Unity. When I call FB.Init on Android device an app opens up FB login window. Device logs shows:
W/fb4a(:<default>):BlueServiceQueue( 5290): Exception during service
W/fb4a(:<default>):BlueServiceQueue( 5290): com.facebook.http.protocol.AuthTokenNullException: auth token is null, user logged out?
W/fb4a(:<default>):BlueServiceQueue( 5290): at com.facebook.http.protocol.SingleMethodRunnerImpl.a(SingleMethodRunnerImpl.java:327)
W/fb4a(:<default>):BlueServiceQueue( 5290): at com.facebook.http.protocol.SingleMethodRunnerImpl.a(SingleMethodRunnerImpl.java:153)
W/fb4a(:<default>):BlueServiceQueue( 5290): at com.facebook.http.protocol.AbstractSingleMethodRunner.a(AbstractSingleMethodRunner.java:16)
W/fb4a(:<default>):BlueServiceQueue( 5290): at com.facebook.katana.server.handler.PlatformOperationHandler.c(PlatformOperationHandler.java:366)
W/fb4a(:<default>):BlueServiceQueue( 5290): at com.facebook.katana.server.handler.PlatformOperationHandler.a(PlatformOperationHandler.java:259)
W/fb4a(:<default>):BlueServiceQueue( 5290): at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:293)
W/fb4a(:<default>):BlueServiceQueue( 5290): at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:53)
W/fb4a(:<default>):BlueServiceQueue( 5290): at com.facebook.fbservice.service.BlueServiceQueue$3.run(BlueServiceQueue.java:230)
W/fb4a(:<default>):BlueServiceQueue( 5290): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
W/fb4a(:<default>):BlueServiceQueue( 5290): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
I have set up app id in Unity and package name, class name (com.facebook.unity.FBUnityPlayerActivity) and my hash keys on Facebook (one I see in Unity Editor and one from ~/.android/debug.keystore. On iOS it behaves as it should - FB.Init goes through and then I can display login window using FB.Login... Any ideas what I'm doing wrong? Help much appreciated!
Best, Dawid
In the same boat, plenty(including myself) have issues where the SD$$anonymous$$ fails during Init on Android. Just to check, you have two different hash key from the debug key-store and the one that Unity is reporting in the Facebook settings? that sounds a little suspect.
If I get more info I'll be sure to post it here.
Regards, Bryan
Answer by abrady · Sep 25, 2013 at 06:51 AM
Hi Dawidk (and Bryan),
We had some problems with the Android SDK that have now been worked out (hopefully!). If you'd like to try the very latest candidate, please grab it here:
http://beta-fb-unity-sdks.parseapp.com/v4.2.4/FacebookSDK.unitypackage
And let me know if that works for you.
Thanks for trying the SDK!
Aaron
the FB package works fine in Unity Editor, but fails on Android.. I have explained my problem clearly at this thread: http://stackoverflow.com/questions/23388069/facebook-fb-init-fail-for-android-unity
Please.. do look into and help me, tell me where i am going wrong.