DLL import settings "Define Constraints" bug?

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:

- Assets/
    - SampleScriptUsingSampleDll.cs
    - Plugins/
        - Sample (DEBUG)/
            - Sample.dll
                (Define Constraints:) "DEBUG"
        - Sample (RELEASE)/
            - Sample.dll
                (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.

Hi, I am experiencing the same issue. Did you find any solution? :slight_smile:

P.S. I am using Unity 2019.1.0f2

Apparently it’s a known issue and is currently in active status.
https://issuetracker.unity3d.com/issues/identical-dll-files-targeting-different-builds-with-define-constraints-conflict-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.