Search Unity

Re: Unable to disable FacebookStore.dll from compiling on unsupported platforms

Discussion in 'Unity IAP' started by hogwash, May 24, 2018.

  1. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
  2. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
    We've created stub DLL's (for Stores.dll and UnityEngine.Purchasing.dll) that we only have enabled for console platforms + we've disabled the official Stores.dll on those same platforms and this seems to workaround the issue for now.
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are still looking into the issue. Your approach is correct, but you would need to be careful to replace the Dll's after an IAP upgrade.
     
  4. Andrew-Carvalho

    Andrew-Carvalho

    Joined:
    Apr 22, 2013
    Posts:
    45
    Chiming in that we have a similar problem.

    Editing the link.xml file in the script folder of the plugin can fix the linker issue by allowing it to ignore missing dlls. Add the ignoreIfMissing="1" attribute to the assembly nodes. I've attached our link.xml.

    It looks like if the linker fails to find the dll the entire chain is removed as I can't find any trace of the purchasing dlls in our target platform's build.
     

    Attached Files:

    • link.zip
      File size:
      336 bytes
      Views:
      381
  5. Francoimora

    Francoimora

    Joined:
    Aug 1, 2013
    Posts:
    69
    Same error here. Unable to set any flag for the Facebook dlls, making the project uncompilable on Nintendo Switch.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The work around from engineering has stated the following, although I am unable to test directly. All the steps might not be necessary in your tests, but might be good to walk through them first with the suggested empty project:
    • Create an empty Unity project.(Save the empty scene as Main.unity just in case)
    • Activate Unity Services, and ensure that IAP (and Analytics, a dependency) are activated.
    • From the IAP Services window, import the Purchasing plugin.
    • Change the target platform to Nintendo Switch. (add Main.unity to the scene list just in case)
    • Try to build an NSP, confirm that errors come regarding "UnityEngine.Purchasing" and "Stores"
    • Configure the plugin at Plugins/UnityPurchasing/bin/Stores.dll to exclude the Switch platform.
    • Build the attached solution, drag the resulting two DLLs into the project root (or anywhere)
    • Mark the plugins as only for Switch.
    • Build again, should get an NSP without issues.
     
  7. DoomGoober

    DoomGoober

    Joined:
    Dec 12, 2013
    Posts:
    7
    I finally managed to exclude FacebookStore.dll from unsupported platform. Basically, go into bin\Facebook and click on FacebookStore. Make sure it's excluded and press Apply. If a dialog prompts you to apply again HIT REVERT. Select some other object that has an inspector to get the inspector off FacebookStore. Clicking a folder WILL NOT WORK. Click something like a material.

    Then go into bin\Facebook\live and click FacebookStore. Make sure it's excluded and press Apply. If the dialog prompts you again, HIT REVERT. Now, get the inspector off of the FacebookStore by selecting something else that has an inspector (I sometimes create an empty material in the "live" folder just so I can get the inspector off the FacebookStore.)

    Now, go back to both FacebookStore.dll and make sure they are still excluded from your platform. They may magically be included for your platform again... turn them off again (maybe do the empty material trick.)

    Amazing 3 years later this bug still exists. I believe there is some code that is actively monitoring FacebookStore.dll and when it detects changes it changes them back to some default or tries to link the live and non-live DLLs for some reason. But luckily it appears to be doing these modifications through the Inspector and the Inspector prompts if you want to take the changes.

    Unity: 2019.3.0f6

    EDIT: Sigh. My co-worker kicked off a build and FacebookStore.dll is back. Something added it back to the build even though it was working and checked in! This is more than frustrating. However, one trick that does work consistently for us is to rename the entire UnityPurchasing folder (assuming you don't want any UnityPurchasing) to "Editor" before running a build, building, then naming the folder back to "UnityPurchasing". This is clearly sub-optimal but...
     
    Last edited: May 1, 2020
  8. DoomGoober

    DoomGoober

    Joined:
    Dec 12, 2013
    Posts:
    7
    @JeffDUnity3D is there a workaround that works for other platform types? Specifically, I want to exclude UnityPurchasing from WebGL builds (but have it enabled on Android and iOS.) But WebGL builds for some reason keep pulling in FacebookStore.dll even though it's excluded for WebGL.

    Thanks!
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The current work around is to use separate projects, granted not ideal. We are hoping to improve this later this year.
     
    alex_roboto likes this.
  10. gregStagwell

    gregStagwell

    Joined:
    Dec 23, 2020
    Posts:
    2
    That is not workaround at all! I Get this right guys!
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Agreed! We just discussed this yesterday as a priority issue for an upcoming release, later this year.
     
    gregStagwell likes this.
  12. RobbGraySBL

    RobbGraySBL

    Joined:
    Feb 4, 2014
    Posts:
    40
    Saying later this year in January is a bit frightening. Is there a trackable bug somewhere?
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    No public trackable issue that I'm aware of. But more specifically, in the April/May time frame.
     
    gregStagwell likes this.