Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

UWP/IL2CPP - Unloading broken assembly error

Discussion in 'Windows' started by Bocci, Sep 24, 2018.

  1. Bocci

    Bocci

    Joined:
    Sep 7, 2013
    Posts:
    15
    I get this error when importing a simple DLL inside my Unity project.

    The DLL is built as a Windows Universal App. It worked fine when using the .NET scripting backend but when we switched to IL2CPP we get the "Unloading broken assembly" error (Unity version 2018.2.8f1).

    Those are the references of my library:

    upload_2018-9-24_10-0-49.png

    From my understanding the error is caused by missing assemblies inside the Unity project to which the DLL refers, is this correct?

    Anyways since we don't have the choice to go back to the .NET backend does someone have any suggestions on what is the cause of the error?

    Thanks!
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,518
    How did you configure the DLL in the plugin importer?
     
  3. Bocci

    Bocci

    Joined:
    Sep 7, 2013
    Posts:
    15
    The settings are shown below:
    upload_2018-9-25_13-32-54.png

    But the error appears after couple of seconds, so I don't really have time to change settings.

    If it can help the target platform is UWP (as stated before it worked fine with the .NET backend)

    Edit: tried playing with the import settings and the error is still there
     
    Last edited: Sep 25, 2018
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,518
    EDIT: if you read my post before, ignore what I said. I totally misread your screenshot.

    Can you report a bug on this?
     
  5. Bocci

    Bocci

    Joined:
    Sep 7, 2013
    Posts:
    15
    If that's the only way I will do so asap
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,518
    Yeah unfortunately I can't really see what's happening without seeing the project setup. Once you report a bug, post the case # (not the link to it) here.
     
  7. Bocci

    Bocci

    Joined:
    Sep 7, 2013
    Posts:
    15
    Since it's not possible to upload the whole project in the bug report, I was building a blank project to show the problem I mentioned. But I run into a problem I already "kinda" of solved:

    When I import the library I get the following error
    The type `System.Object' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    upload_2018-9-27_10-45-39.png

    NB: this error is present with the .NET backend and the IL2CPP

    Previously I solved that problem by following the suggestion from this thread: https://forum.unity.com/threads/pro...in-an-assembly-that-is-not-referenced.494051/
    Copying the System.Runtime in the plugin folder from the editor install.

    I believe this could be the cause of the issue mentioned in the OP.

    So if you have any suggestions on how I could solve this second error or should I just fill a bug report with this new error, so you can take a closer look?

    Thanks in advance for your time!
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,518
    What is the API Compatibility level setting in player settings set to?
     
  9. Bocci

    Bocci

    Joined:
    Sep 7, 2013
    Posts:
    15
    Sorry for the delay in the reply, but after some tests we managed to solve the issue.

    In the DLL we were using the "NETFX_CORE" directive, and we didn't realize it's only valid for .NET and not IL2CPP. So that was it.

    Concerning the error in the OP, we are not sure of the cause but by unchecking editor as a compatible platform on the DLL it's not an issue.

    Again thanks for your time!

    PS: the error in #7 we didn't solve it, but since we are switching to 2018 it's not an issue