Facebook-sdk-for-unity: 导入 SDK 时崩溃 (Unity 2019.3.0f3)

创建于 2020-01-05  ·  4评论  ·  资料来源: facebook/facebook-sdk-for-unity

将Facebook SDK 7.18.0(官网下载)导入到空的Unity 2019.3.0f3项目中会导致崩溃,报错如下:

ArgumentException: Requested value 'X86' was not found.
System.Enum+EnumResult.SetFailure (System.Enum+ParseFailureKind failure, System.String failureMessageID, System.Object failureMessageFormatArgument) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Enum.TryParseEnum (System.Type enumType, System.String value, System.Boolean ignoreCase, System.Enum+EnumResult& parseResult) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Enum.Parse (System.Type enumType, System.String value, System.Boolean ignoreCase) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Enum.Parse (System.Type enumType, System.String value) (at <437ba245d8404784b9fbab9b439ac908>:0)
GooglePlayServices.AndroidAbis.EnumValueStringToULong (System.Type enumType, System.String enumValueString) (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/AndroidAbis.cs:182)
GooglePlayServices.AndroidAbis.get_Current () (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/AndroidAbis.cs:241)
GooglePlayServices.PlayServicesResolver.PollAndroidAbis () (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1126)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Delegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Delegate.DynamicInvoke (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)

每当您尝试打开项目时,无论您是否尝试更新过时的 API,它也会崩溃。

有没有办法解决这个问题?

最有用的评论

谢谢@rahil-p,解决了崩溃问题! 但是当我尝试构建提供的 MainMenu 场景时,它给出了这个错误:

Error building Player: Component GUI Layer in Main Camera for Scene Assets/FacebookSDK/Examples/MainMenu.unity is no longer available.
It will be removed after you edit this GameObject and save the Scene.

任何指针?

所有4条评论

目前尚不清楚 SDK 是否仍在更新。 您使用的是 Windows 还是 Mac?

OS X 10.15.1。

这很不幸……除了 REST API 之外还有其他选择吗?

@michelleran我相信问题源于PlayServicesResolver子目录; Facebook Unity SDK v7.18 目前使用 Play Services Resolver v1.2.95(提交 https://github.com/facebook/facebook-sdk-for-unity/commit/17849bc0d9352a82538ffc72b73e7d490953aeff)。 将解析器升级到v1.2.116+应该可以解决问题。

这应该对你有用,希望:

  1. 删除使用 Facebook Unity SDK 导入的 PlayServicesResolver 文件夹。
  2. 下载最近的 Play Services Resolver 包(例如v1.2.135 )并导入到您的项目中。

谢谢@rahil-p,解决了崩溃问题! 但是当我尝试构建提供的 MainMenu 场景时,它给出了这个错误:

Error building Player: Component GUI Layer in Main Camera for Scene Assets/FacebookSDK/Examples/MainMenu.unity is no longer available.
It will be removed after you edit this GameObject and save the Scene.

任何指针?

此页面是否有帮助?
0 / 5 - 0 等级