Facebook FB.Init() Fail for Android Unity

你。 提交于 2019-11-27 08:31:12

问题


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.

The Facebook Settings are as follows:

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?


回答1:


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!!!



来源:https://stackoverflow.com/questions/23388069/facebook-fb-init-fail-for-android-unity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!