Search Unity

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

Discussion in 'Unity IAP' started by hba_infinity, Jun 28, 2017.

Thread Status:
Not open for further replies.
  1. hba_infinity

    hba_infinity

    Joined:
    May 30, 2016
    Posts:
    35
    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?
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,277
    @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
     
  3. hba_infinity

    hba_infinity

    Joined:
    May 30, 2016
    Posts:
    35
    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
    Bin-Facebook-FacebookStore.PNG

    UnityPurchasing\Bin\Facebook\live\FacebookStore.dll
    Bin-Facebook-Live-FacebookStore.PNG
     
  4. hba_infinity

    hba_infinity

    Joined:
    May 30, 2016
    Posts:
    35
    @ap-unity - Here is a video showing explaining what happens, which can be viewed here -
     
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,277
    @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.
     
  6. hba_infinity

    hba_infinity

    Joined:
    May 30, 2016
    Posts:
    35
    @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.
     

    Attached Files:

  7. hba_infinity

    hba_infinity

    Joined:
    May 30, 2016
    Posts:
    35
    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?
     
  8. hba_infinity

    hba_infinity

    Joined:
    May 30, 2016
    Posts:
    35
    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?
     
  9. hba_infinity

    hba_infinity

    Joined:
    May 30, 2016
    Posts:
    35
    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
     
    Last edited: Jul 7, 2017
  10. sambickley

    sambickley

    Unity Technologies

    Joined:
    Jan 9, 2014
    Posts:
    247
    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.
     
  11. hba_infinity

    hba_infinity

    Joined:
    May 30, 2016
    Posts:
    35
    Hey @sambickley,

    Thanks for the update, I'll keep an eye out on any future emails about this issue.
     
Thread Status:
Not open for further replies.