我正在尝试将Unity的官方Android SDK合并到我的项目中。在我在Unity内部的facebook选项上设置所有内容并进行构建后,每次调用FB.Init()时都会得到:
AndroidJavaException: java.lang.ClassNotFoundException: com.facebook.unity.FB
at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0
at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown>:0
at UnityEngine.AndroidJavaObject._CallStatic[AndroidJavaObject] (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
at UnityEngine.AndroidJavaObject.CallStatic[AndroidJavaObject] (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
at UnityEngine.AndroidJavaObject.FindClass (System.String name) [0x00000] in <filename unknown>:0
at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) [0x00000] in <filename unknown>:0
at UnityEngine.AndroidJavaClass..ctor (System.String className) [0x00000] in <filename unknown>:0
at Facebook.AndroidFacebook.get_FB () [0x0000b] in C:\Users\motionart\Documents\Unity Projects\
我甚至启用了“开发构建”和“脚本调试”,但所有内容都发生在<filename unknown>
上,所以我真的不知道如何继续。
知道会发生什么事吗?
答案 0 :(得分:3)
SDK在我的项目中,它是唯一的。经过几个小时的努力,解决问题的唯一方法是从我的项目中删除sdk的所有痕迹并再次导入。
然后它奏效了。
答案 1 :(得分:0)