Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

DLL import settings "Define Constraints" bug?

Discussion in 'Scripting' started by jilleJr, Jul 26, 2019.

  1. jilleJr

    jilleJr

    Joined:
    Jan 21, 2015
    Posts:
    51
    Trying to have multiple (platform-dependent) versions of the equivalent DLL but receiving error on build.

    This seems to be thing with the "Define Constraints" field on Import Settings. But here's the test setup:

    Code (csharp):
    1. - Assets/
    2.     - SampleScriptUsingSampleDll.cs
    3.     - Plugins/
    4.         - Sample (DEBUG)/
    5.             - Sample.dll
    6.                 (Define Constraints:) "DEBUG"
    7.         - Sample (RELEASE)/
    8.             - Sample.dll
    9.                 (Define Constraints:) "!DEBUG"
    Work fine in the editor! Only the DEBUG variant is active.

    However, trying to build I receive the following errors:

    It's like the constraint is ignore in an early stage of the build.

    Is this a known problem and/or does anyone have any ideas of a workaround?
    Thank you for all yours times.
     
  2. lukas-hoeppner

    lukas-hoeppner

    Joined:
    Aug 22, 2015
    Posts:
    11
    Hi, I am experiencing the same issue. Did you find any solution? :)

    P.S. I am using Unity 2019.1.0f2
     
  3. jilleJr

    jilleJr

    Joined:
    Jan 21, 2015
    Posts:
    51
    Apparently it's a known issue and is currently in active status.
    https://issuetracker.unity3d.com/is...flict-with-each-other-when-building-a-project

    One theoretically possible workaround is to rename the assemblies if you got the source, but have them use the same namespaces. Maybe then you can bypass the plug-in collision check.
     
unityunity