Facebook FB.Init() 对于 Android Unity 失败 [英] Facebook FB.Init() Fail for Android Unity

查看:25
本文介绍了Facebook FB.Init() 对于 Android Unity 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Unity 4.1.2我已经从开发人员的站点下载了最新的 Facebook SDK for Android 包以实现统一.包文件名是FacebookSDK-140401.unitypackage"包是: 5.1 , April 1,2014我创建了一个新的空项目.导入了包.打开包自带的示例场景:InteractiveConsole"我在我的 Unity 编辑器中玩游戏并按下 FB.Init() 它工作正常.以下是游戏截图和调试输出.

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.

Facebook 设置如下:

The Facebook Settings are as follows:

您可以自由使用它们并进行测试并返回到此问题.

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

问题是这在 Unity Editor 中工作正常,但是当我构建应用程序并将其传输到我的 android 手机(Samsung Galaxy Tab 2)并播放时,屏幕打开,一切看起来都正常.当我点击FB.Init"按钮时,游戏会挂起一段时间,然后崩溃到我的主屏幕.

PS:我的手机上没有安装任何 Facebook 应用程序.有必要吗?

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

推荐答案

我遇到了同样的问题,在统一编辑器中工作正常,但在 android 手机中无法工作.我也在使用游戏分析 sdk,所以我的 Assets 文件夹中有两个支持版本:

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:

  • AssetsPluginsAndroidsupport-v4-24.2.0 中的第一个
  • AssetsFacebookSDKPluginsAndroidlibssupport-v4-23.4.0 中的第二个

由于不支持多个支持版本,我删除了第二个.

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

对我来说这是问题所在,FB.Init() 在手机中不起作用.

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

这篇关于Facebook FB.Init() 对于 Android Unity 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆