简体   繁体   English

Facebook FB.Init()无法用于Android Unity

[英]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设置如下: 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:

  • 1st one in Assets\\Plugins\\Android\\support-v4-24.2.0 Assets \\ Plugins \\ Android \\ support-v4-24.2.0中的第一个
  • 2nd one in Assets\\FacebookSDK\\Plugins\\Android\\libs\\support-v4-23.4.0 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. 对我来说,这就是问题所在,FB.Init()在电话中无法运行。

When I delete First one and keep the 2nd one, Its worked!!! 当我删除第一个并保留第二个时,它起作用了!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 调用fb.init时,Android上的Facebook Unity SDK崩溃 - Facebook Unity SDK on Android crashes when fb.init is called 适用于Android的Unity的Facebook SDK尝试在不调用FB.login的情况下登录FB.init - Facebook SDK for Unity on Android tries to login on FB.init without calling FB.login 适用于Unity的Facebook SDK v7.0.3 FB.Init委托从未调用 - Facebook SDK for Unity v7.0.3 FB.Init delegate never called Facebook sdk for unity 显示 NullReferenceException: Facebook object is not yet loaded。 你调用了 FB.Init() 了吗? 在谷歌内部测试中 - Facebook sdk for unity shows NullReferenceException: Facebook object is not yet loaded. Did you call FB.Init()? on google internal test Facebook Connect / phonegap - FB.init调用中的“nativeInterface”参数,它有什么作用? - Facebook Connect / phonegap - “nativeInterface” parameter within FB.init call, what it does? Apache Cordova Facebook插件在Init上失败 - Android - Apache Cordova Facebook Plugin Fail On Init - Android Facebook Unity SDK(Android)-FB.Feed白屏 - Facebook Unity SDK (Android) - FB.Feed white screen Android上的Facebook Unity SDK - 安装FB App时登录失败 - Facebook Unity SDK on Android - Login fails when FB App installed Cordova Facebook Connect在init上失败 - Cordova Facebook Connect fail on init Unity Facebook SDK:FB.Feed不发布 - Unity Facebook SDK: FB.Feed not posting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM