Facebook SDK Problem

i import facebook sdk 7.9.0. i get following error. I think unity adds buildin facebook sdk.

error CS1704: An assembly with the same name Facebook.Unity' has already been imported. Consider removing one of the references or sign the assembly Library/FacebookSDK/Facebook.Unity.dll (Location of the symbol related to previous error) Assets/FacebookSDK/Plugins/Facebook.Unity.dll (Location of the symbol related to previous error) error CS1704: An assembly with the same name Facebook.Unity.Settings’ has already been imported. Consider removing one of the references or sign the assembly
Library/FacebookSDK/Facebook.Unity.Settings.dll (Location of the symbol related to previous error)
Assets/FacebookSDK/Plugins/Settings/Facebook.Unity.Settings.dll (Location of the symbol related to previous error)

2 Likes

what is your build target?

@hencz Facebook Gameroom

Then I don’t think you need to add a facebook sdk explicitly, try removing it

@hencz When i remove it, it works. my game is not just for facebook. for android and ios i must keep facebook sdk in my project. so it is not good for me to remove it on each facebook build.

The idea is that any Facebook SDK you include in your project should override the built-in one. However, this is broken in 5.6 right now. It will be fixed in 5.6 later, but for now, you should either delete the SDK in your project to make it work, or disable it for Standalone and WebGL platforms (in the plugin inspector of the dlls) to work around the problem.

@jonas-echterhoff_1 it is the same for gameroom beta 5.5.0f2 and 5.5.0f3 at Facebook Games - Documentation - Meta for Developers

As i remember disabling it for standalone and webgl did not work. i will try again. maybe restarting unity is required.

it doesn’t work, even if you try to run it for windows universal 10, you’ll get an error if you have the sdk imported. And if you remove it, then all hell breaks lose in the other platforms

I guess you may have to disable it for the editor as well. Or wait for the fix, which will be in a future 5.6 build.

FB for 5.6 is still broken in the RC @jonas-echterhoff_1 – check this out:

https://github.com/facebook/facebook-sdk-for-unity/issues/70