Facebook-sdk-for-unity: 7.11.x missing 'Facebook.Unity.Canvas' on WebGL

Created on 26 Mar 2018  ·  22Comments  ·  Source: facebook/facebook-sdk-for-unity

Hey guys,
after upgrading the SDK to 7.11.x (both 7.11 and 7.11.1) i get the following error when running the app:

FileNotFoundException: Could not load file or assembly 'Facebook.Unity.Canvas' or one of its dependencies. The system cannot find the file specified.

I already tried to adjust link.xml because i thought it might be a stripping issue, but it didn't help.

<assembly fullname="Facebook.Unity.Canvas" ignoreIfMissing="1">
  <type fullname="Facebook.Unity.Canvas.*" preserve="all"/>
</assembly>
<assembly fullname="Facebook.Unity.*" ignoreIfMissing="1">
  <type fullname="Facebook.Unity.*" preserve="all"/>
</assembly>

If somehow relevant i am using Unity 2017.3.p4

Best Wishes
MoinTom

All 22 comments

Same for me

yep - same here

me too. using Unity 2017.2.1

Same here, very annoying

same for me.

no commits for 28 days on this repository - is that normal?
(Ok looking at the commit history it seems to be normal)

Hey guys,

I created a pull request #160 , which should fix that issue for you (I had the same issue, but now everything is working again with FB SDK 7.10+).

The only thing I haven't tested is the ability to log out and in again in the Facebook WebGL game (because in our game you can't log out in a facebook WebGL game, and Facebook is automatically signing you in with the init call.

If you don't want to wait until Facebook has merged it or fixed it on their own, here are the steps to fix the broken WebGL build:
1) Replace the CanvasJSSDKBindings.jslib with the one of my pull request link
(if your project is missing the file, Copy mine into [ProjectRoot]/Assets/FacebookSDK/Plugins/Canvas/Plugins/)
2) If you use code stripping, at the following line to your link.xml (or the Facebook link.xml):
<assembly fullname="Facebook.Unity.Canvas" ignoreIfMissing="1"> <type fullname="Facebook.Unity.Canvas.*" preserve="all"/> </assembly>
3) If you are missing the Facebook.Unity.Canvas.dll (because it is not in the UnityPackage of the FB Unity SDK):
Download the FB Unity SDK repo and build the [repo]/Facebook.Unity.Canvas/Facebook.Unity.Canvas.sln, after that copy the [repo]/Facebook.Unity.Canvas/bin/release/Facebook.Unity.Canvas.dll to your [ProjectRoot]/Assets/FacebookSDK/Plugins/Canvas/ folder

I pushed fixes for Login and LogAppEvent, can be found on the Pull Request and also on my Repo.

is this issue only with 7.11.x and higher? what if i downgrade to 7.10.1 ?

It should not help, any version above 7.9.X is incorrect, they changed the general WebGL behavior in 7.10.0 since them it was not resolved.

I downgraded to 7.10.1 and it worked for me.

Same with me. I've ran into this error with 7.11.1, downgraded to 7.10.1 and WebGL builds (Unity, targeting Facebook app) seems to be working fine now.

Oh yeah you both are right. The issue was introduced in 7.11 with the changes to thr ExternalAPI on WebGl (thought ideas on 7.10). But if you need to use 7.11, just use my changes to the 2 webgl files and it will also work. (7.11 is also more elegant because the Facebook code is not getting directly injected into your html anymore.)

still the same problem with the latest version 7.12

Well, if you look at the changes of 7.12, more or less nothing has changed :)

Anyone opened a bug on Facebook for this? is so, whats the bug id?

Here is a facebook bug I opened myself. Please subscribe:
https://developers.facebook.com/support/bugs/208041073313482/

Seem to be fixed with v7.12.1

Unfortunately they introduced a new bug:
https://developers.facebook.com/support/bugs/1821608858133184/

So be prepared if you decide to update.

Getting the same bug using FB SDK 7.13.0, fix posted above does not work. Not solved.

7.13.0 plugin some error. not solved.

Hey all, the issue can be fixed with following steps:

  1. In Unity IDE, go to director Assets->FacebookSDK->Plugins, where there are several plugins including Android, iOS, Canvas;
  2. Choosing correct platform for plugin, for example, goto Android director and only chooses "Android" for plugins in the inspector
Was this page helpful?
0 / 5 - 0 ratings