Search Unity

DLL import settings "Define Constraints" bug?

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

  1. Applejag

    Applejag

    Joined:
    Jan 21, 2015
    Posts:
    21
    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:
    4
    Hi, I am experiencing the same issue. Did you find any solution? :)

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

    Applejag

    Joined:
    Jan 21, 2015
    Posts:
    21
    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.