[英]Facebook FB.Init() Fail for Android Unity
I am using Unity 4.1.2 I have downloaded the latest Facebook SDK for Android package for unity from the developer's site. 我正在使用Unity 4.1.2,我已经从开发人员的站点下载了最新的Android版Facebook SDK软件包。 The package file name is "FacebookSDK-140401.unitypackage" The package is: 5.1 , April 1,2014 I created a new empty project. 程序包文件名为“ FacebookSDK-140401.unitypackage”。程序包为:5.1,2014年4月1日,我创建了一个新的空项目。 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. 打开与包一起提供的Example场景:“ InteractiveConsole”我在Unity编辑器中玩了游戏,然后按FB.Init(),它工作正常。 Here are the screenshots of the game and debug output. 这是游戏和调试输出的屏幕截图。
The Facebook Settings are as follows: Facebook设置如下:
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. 问题是,这在Unity Editor中工作正常,但是当我构建应用并将其转移到我的Android手机(三星Galaxy Tab 2)并播放它时,屏幕打开,一切看起来都还不错。 when I hit 'FB.Init' button, the game hangs for a while and it crashes to my home screen. 当我按下“ FB.Init”按钮时,游戏挂起了一段时间,并崩溃到了我的主屏幕。
PS: I don't have any Facebook App installed on my phone. PS:我的手机上没有安装任何Facebook App。 Is it necessary? 有必要吗?
I faced same problem, working fine in unity editor, but not working in android phone. 我遇到了同样的问题,在unity编辑器中工作正常,但在android手机中无法工作。 I was using game analytics sdk also, so I got two support-version in my Assets folder: 我也在使用游戏分析SDK,因此我的Assets文件夹中有两个support-version:
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. 对我来说,这就是问题所在,FB.Init()在电话中无法运行。
When I delete First one and keep the 2nd one, Its worked!!! 当我删除第一个并保留第二个时,它起作用了!!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.