Search Unity

DllNotFoundException: user32.dll

Discussion in 'Unity Build Automation' started by bagelbaker, Jun 9, 2017.

  1. bagelbaker

    bagelbaker

    Joined:
    Jun 5, 2017
    Posts:
    67
    Yesterday, we were on Unity 5.4.1p1 and we had successful build even though we had this:
    [Unity] DllNotFoundException: user32.dll
    Today, we're on Unity 5.6.1p2 and have the same log but then it finished with this:
    1665: [Unity] Player export failed. Reason: DllNotFoundException: user32.dll
    1666: ! build of 'default-windows-desktop-64-bit' failed. compile failed
    1667: publishing finished successfully.
    1668: Finished: FAILURE​

    We are building for Windows desktop 64-bit and locally we are on building on Windows
    1) How come we get the DllNotFoundException on Unity cloud but not not locally? What platform is Unity cloud running on?
    2) How come the builds now fail because of this?
    3) What is the solution to prevent this error? Should we include user32.dll in the project?

    Thanks!
     
    Last edited: Jun 9, 2017
  2. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    786
    Looks like you got it working (I'm assuming by removing the dll?). Was this user32.dll the x86 or x64 version?

    And to answer your question about what platform UCB runs on, it's OSX.
     
  3. bagelbaker

    bagelbaker

    Joined:
    Jun 5, 2017
    Posts:
    67
    yes it's working now because we commented the functionality that was using it since we needed the builds to pass successfully. To be clear, we don't include user32.dll in the project.

    • On UCB, we are building for windows desktop 64-bit. (I'm changing this now to 32 bits for unrelated reasons)
    • Locally, I'm on windows 64 bit. The builds are working locally for both 32 and 64 bits.
    • In the code, we were using
      Code (CSharp):
      1. [DllImport("user32.dll")]
    • I did try to include user32.dll (taken from my C:\Windows\System32\ folder) in the project but that didn't solve the issue. In any case, I don't feel like including user32.dll in the project/build is a good idea.
     
  4. bagelbaker

    bagelbaker

    Joined:
    Jun 5, 2017
    Posts:
    67
    So I guess that's the source of the issue. Our windows build only works when built on Windows because of the need for user32.dll.
    Any upcoming solution from UCB side? Is there something we can try to solve this on our side without needing to include user32.dll in the build (which didn't work anyway)?