Facebook FB.Init() Fail for Android Unity
Asked Answered
H

1

3

I am using Unity 4.1.2 I have downloaded the latest Facebook SDK for Android package for unity from the developer's site. The package file name is "FacebookSDK-140401.unitypackage" The package is: 5.1 , April 1,2014 I created a new empty project. Imported the package. Opened the Example scene that came with the package: "InteractiveConsole" I played the game in my Unity Editor and pressed FB.Init() it worked fine. Here are the screenshots of the game and debug output.

Game Screen Debug Output

The Facebook Settings are as follows: FacebookSettings

you are free to use them and test and revert to this question.

The problem is this works fine in Unity Editor, but when I build the app and transfer it to my android phone(Samsung Galaxy Tab 2) and play it, the screen opens and everything looks okay. when I hit 'FB.Init' button, the game hangs for a while and it crashes to my home screen.

PS: I don't have any Facebook App installed on my phone. Is it necessary?

Hobson answered 30/4, 2014 at 12:26 Comment(3)
@aaron, I am tagging you in this question, becoz i saw you solve many other questions in this field. Please don't mind. Thanks in advance.Hobson
please help me.. I am about to go crazy..Hobson
hi @silentkratos, really sorry for the delay in getting back to you. It looks like your app was deleted on April 29. Is this related? Also, were you actually able to login using an access token in the editor? Also, can you post the android logcat log so I can see what your app is doing when it is trying to login? regarding login: you don't need the app installed to login, it should use a webview in that casePriapism
W
0

I faced same problem, working fine in unity editor, but not working in android phone. I was using game analytics sdk also, so I got two support-version in my Assets folder:

  • 1st one in Assets\Plugins\Android\support-v4-24.2.0
  • 2nd one in Assets\FacebookSDK\Plugins\Android\libs\support-v4-23.4.0

As not support more than one support-version, I deleted 2nd one.

For me it was the problem, FB.Init() was not working in phone.

When I delete First one and keep the 2nd one, Its worked!!!

Wyne answered 5/10, 2016 at 10:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.