Search Unity

Native plugin in package causing copy/delete errors

Discussion in 'Package Manager' started by SLGSimon, Nov 21, 2019.

  1. SLGSimon

    SLGSimon

    Joined:
    Jul 23, 2019
    Posts:
    24
    I'm getting errors for my native DLL in my custom package (from git https://github.com/StrangeLoopGames/RuntimeGraphicsInfo)

    Could not delete file 'Library/ScriptAssemblies/RuntimeGraphicsInfo.dll.bak'

    UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:371)​

    and

    Copying assembly from 'Temp/RuntimeGraphicsInfo.dll' to 'Library/ScriptAssemblies/RuntimeGraphicsInfo.dll' failed​

    Is there something I can do to stop this from happening? I suspect it has something to do with the native plugin being loaded in the editor...
     
  2. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    72
  3. SLGSimon

    SLGSimon

    Joined:
    Jul 23, 2019
    Posts:
    24
    Let me ask a package manager specific question then: what is expected to happen when you have a native dll in a package and the package updates? As native plugins are never unloaded it would always cause an error correct?
     
  4. SLGSimon

    SLGSimon

    Joined:
    Jul 23, 2019
    Posts:
    24
    It looks like the problem was caused by an error on my part, I renamed the native dlls to something else, and it was instead trying to load the managed dll into itself.

    Now that is working correctly, I can't update the package while unity is running - as I expected - as the native plugin is loaded from there.