[Solved] Unable to disable FacebookStore.dll from compiling on unsupported platforms

We have recently implemented UnityIAP into our project, but since then, platforms which do not support UnityIAP are still attempting to be compiled on those platforms.

While trying to disable the platforms for dlls, we have observed that the FacebookStore.dll is unable to exclude any platforms.

Once you click Apply, you then wait for Unity to compile the platform changes, to when you deselect and select FacebookStore.dll again to find out that the changes have been reverted.

Keeping this dll enabled breaks builds for any AOT platforms (e.g. PS4/XB1), so we would like to remove this DLL on those platforms. Any opinions on what to do?

1 Like

@hba_infinity

What version of Unity are you using and which version or the IAP plugin are you using?

Could you provide a screenshot of the Inspector when you highlight the FacebookStore.dll? There should be one in each of the following directories:
/Plugins/UnityPurchasing/Bin/Facebook/live
/Plugins/UnityPurchasing/Bin/Facebook

Hey @ap-unity ,

We are using Unity 5.5.0p4 using UnityPurchasing 1.11.4 (I believe from the latest entry in the changelist.md).

Below are the images of the 2 dlls you have asked for. The FacebookStore in the Facebook folder (not live) is the one which is causing compile issues on both PS4 and XboxOne builds. This is mainly due to trying to exclude this plugin from those platforms, but once Unity compiles, it returns Any Platform again.

UnityPurchasing\Bin\Facebook\FacebookStore.dll

UnityPurchasing\Bin\Facebook\live\FacebookStore.dll
3125726--236760--Bin-Facebook-Live-FacebookStore.PNG

@ap-unity - Here is a video showing explaining what happens, which can be viewed here -

@hba_infinity

Would you be able to share a copy of your editor.log?

If you change your Asset Serialization mode to Forced Text (under Edit → Project Settings → Editor), it is possible to manually modify the .meta file for the FacebookStore.dll. However, this should be done automatically for non-facebook platforms. The editor log might give us a bit more insight into what’s going wrong.

@ap-unity
Our game is already set to Force Text for Asset Serialization, and from our Source Control, The appropriate values are being set. Here is the attached meta file to show what it is being saved as. From what I can tell, I’ve even tried forcing the plugin using an AssetPostProcessor - OnPostprocessAllAssets and setting the compatibility to be disabled on both PS4 and XboxOne, yet it still reverts.

I’ve uploaded a copy of the editor log, the meta file for that file and the build failure logs from our build machine.

3125775–236767–FacebookStore.dll.meta.txt (1.69 KB)
3125775–236768–Editor.log.txt (430 KB)
3125775–236769–Facebook Build Errors.txt (298 KB)
3125775–236770–XB1 Build Errors.txt (499 KB)

I’ve been looking into it more, and it seems to be a loop of dll dependencies which is breaking our builds. UnityEngine.Purchasing is required for Bin\Stores.dll. FacebookStore.dll requires Bin\Stores.dll. UnityEngine.Purchasing is ignored on PS4 and XB1 builds, so we have to also not add Bin\Stores.dll, which means we cannot use FacebookStore.dll. Removing FacebookStore.dll makes our Console Builds work, but breaks all other platforms, where the opposite is true when we leave it there.

It’s almost a Catch22… is there an alternate way to disable FacebookStore.dll?

Ok, so I believe I’ve found a solution to this.

It looks like the FacebookStore.dll must have some PostProcessor running on it to override the Platform settings. If this is the case, I think it may be a bug, as platforms like Playstation 4 and Xbox One cannot have the FacebookStore.dll included.

To fix this issue, I’ve simply renamed the FacebookStore.dll file. I’m guessing this breaks the PostProcessing which is running on the file to revert the settings to run on all platforms.

Just to make sure, will renaming the dll cause any issues further down the track?

Hey @ap-unity ,

Just looking further into this issue and I’ve noticed that renaming the file has fixed (most) of our console problems, but is still having issues on iOS, XB1 and PS4. I think some of them are alright to ignore (Mainly the UnityIAP: [InitializeOnLoad] Facebook Check ones for PS4 and Xbox One), but the iOS error breaks the build.

Any tips which you can help with for getting UnityIAP working with these errors?

EDIT: I have also posted a bug for it: 926378

Hey,

I’ve passed this bug on to the relevant team for investigation.

Note that this isn’t an Xbox One specific bug, and won’t be handled by our team here, so expect all future correspondence to make its way to you via email on the case.

Hey @sambickley ,

Thanks for the update, I’ll keep an eye out on any future emails about this issue.