hecomi / uDesktopDuplication

Desktop Duplication API implementation for Unity (only for Windows 8/10)
http://tips.hecomi.com/entry/2016/12/04/125641
MIT License
563 stars 97 forks source link

Plugin fails to load since updating to v1.5.5 #25

Closed lux closed 5 years ago

lux commented 6 years ago

Since upgrading to v1.5.5, I can't seem to get past this error:

Plugins: Failed to load 'Assets/uDesktopDuplication/Plugins/x86_64/uDesktopDuplication.dll' with error 'The specified module could not be found.
'.
UnityEngine.GameObject:AddComponent()
uDesktopDuplication.Manager:CreateInstance() (at Assets/uDesktopDuplication/Scripts/Manager.cs:27)
uDesktopDuplication.Manager:get_instance() (at Assets/uDesktopDuplication/Scripts/Manager.cs:13)
uDesktopDuplication.Manager:get_primary() (at Assets/uDesktopDuplication/Scripts/Manager.cs:51)
uDesktopDuplication.Texture:OnEnable() (at Assets/uDesktopDuplication/Scripts/Texture.cs:246)

After which I get a DllNotFoundException here:

DllNotFoundException: uDesktopDuplication
uDesktopDuplication.Manager.Awake () (at Assets/uDesktopDuplication/Scripts/Manager.cs:100)
UnityEngine.GameObject:AddComponent()
uDesktopDuplication.Manager:CreateInstance() (at Assets/uDesktopDuplication/Scripts/Manager.cs:27)
uDesktopDuplication.Manager:get_instance() (at Assets/uDesktopDuplication/Scripts/Manager.cs:13)
uDesktopDuplication.Manager:get_primary() (at Assets/uDesktopDuplication/Scripts/Manager.cs:51)
uDesktopDuplication.Texture:OnEnable() (at Assets/uDesktopDuplication/Scripts/Texture.cs:246)

And then this error repeating:

[uDD::Error] there is no monitor whose id is 0.
UnityEngine.Debug:LogErrorFormat(String, Object[])
uDesktopDuplication.Manager:GetMonitor(Int32) (at Assets/uDesktopDuplication/Scripts/Manager.cs:79)
uDesktopDuplication.Texture:Reinitialize() (at Assets/uDesktopDuplication/Scripts/Texture.cs:283)
uDesktopDuplication.Texture:KeepMonitor() (at Assets/uDesktopDuplication/Scripts/Texture.cs:266)
uDesktopDuplication.Texture:Update() (at Assets/uDesktopDuplication/Scripts/Texture.cs:258)

I've verified that the DLLs are there, that they're targeted to the right platforms already (x86 vs 64), and I've tried on two machines by deleting uDesktopDuplication and reimporting it, restarting Unity, and no luck.

I imagine I'm missing a step to get Unity to recognize the updated DLLs. In the meantime, downgrading to v1.5.4 fixed it.

Also in case it's any help, uDesktopDuplication.log just has this in it:

[uDD::Log][2018-09-13 15:09:08] Start
[uDD::Log][2018-09-13 15:09:08] Duplicator::Initialize() => OK.
[uDD::Log][2018-09-13 15:09:08]     ID    : 0
[uDD::Log][2018-09-13 15:09:08]     Size  : (3840, 2160)
[uDD::Log][2018-09-13 15:09:08]     DPI   : (162, 161)
[uDD::Log][2018-09-13 15:09:08]     Rot   : Landscape
[uDD::Log][2018-09-13 15:09:08] Duplicator::Initialize() => OK.
[uDD::Log][2018-09-13 15:09:08]     ID    : 1
[uDD::Log][2018-09-13 15:09:08]     Size  : (3840, 2160)
[uDD::Log][2018-09-13 15:09:08]     DPI   : (162, 161)
[uDD::Log][2018-09-13 15:09:08]     Rot   : Landscape
[uDD::Log][2018-09-13 15:10:36] Stop
hecomi commented 5 years ago

I am very sorry for the late reply...

I couldn't regenerate the situation, so please let me know the version of Unity which caused the error. Or could you try to do the same process with a simple project?

And where did you find the [uDD::Error] log? The .log doesn't seems to have any problem and [uDD::Error] log is regulary output to a .log file.

lux commented 5 years ago

I'm using Unity 2017.3.1p1. This was a fairly simple project, so I'm not sure if I can simplify it further. The errors shown were in the Unity console, which probably explains why the log seems ok.

hecomi commented 5 years ago

Thank you for providing information. I'll try the conversion from 1.5.4 to 1.5.5 using 2017.3.1p1.

hecomi commented 5 years ago

Sorry, I was not able to reproduce the problem in my environment with 2017.3.1p1..., but I've updated the version to v1.5.6 and rebuilt DLLs. So please try this version if you have time.

lux commented 5 years ago

Finally got a chance to test it and the new package imported with no problems. Thanks!

hecomi commented 5 years ago

Thanks for the test! I'm very glad to hear that.