bkeiren / AwesomiumUnity

Third-party Awesomium wrapper for Unity3D, wrapping Awesomium's C++ API with a custom C# API and accompanying Unity MonoBehaviour components.
108 stars 74 forks source link

DllNotFoundException: AwesomiumUnity #2

Open Anderz000 opened 9 years ago

Anderz000 commented 9 years ago

Hi! We're excited about the prospects of this integration, but we're facing an issue.

Despite putting the AwesomiumUnity.dll file in the Assets/Plugins/ folder -- we've tested both the pre-build dlls provided by this package -- we're getting the following error with the example webtexture script when we try running the game. Any ideas why?

DllNotFoundException: AwesomiumUnity AwesomiumUnityWebCore.get_IsRunning () (at Assets/AwesomiumUnityScripts/AwesomiumUnityWebCore.cs:140) AwesomiumUnityWebCore.EnsureInitialized () (at Assets/AwesomiumUnityScripts/AwesomiumUnityWebCore.cs:146) AwesomiumUnityWebTexture.Initialize () (at Assets/AwesomiumUnityScripts/AwesomiumUnityWebTexture.cs:71) AwesomiumUnityWebTexture.Start () (at Assets/AwesomiumUnityScripts/AwesomiumUnityWebTexture.cs:99)

Awesomium 1.7.5.0 Unity 4.6.2f1 Pro Windows 7 x64 (Admin acccount)

bkeiren commented 9 years ago

Hi, thanks for your interest in AwesomiumUnity!

Can you tell me whether you are trying to run your game as a standalone executable or in-editor?

Now, there are a couple of things we must check and try:

Firstly I would like to ask you whether you've also copied the dependencies to the proper folders. Note that besides the AwesomiumUnity DLL there a couple of files from the Awesomium SDK which you will need to both copy to a folder of your Unity installation (not your project) to ensure proper functioning in the editor, as well as copy them to your executable location if you are building a standalone version of your game. The reason why I mention this for you is that I've heard of Unity throwing the DllNotFoundException if any of a DLL's dependencies cannot be loaded (apparently without being specific about which DLL can't be loaded).

If the above does not fix your issue, could you try to perform the following steps to see if they change anything:

Also, could you check your Assets folder in the editor window to see if the Plugins folder does actually contain the DLL and is recognised by the Unity Editor.

Also I'd like to point out that AwesomiumUnity currently only supports Windows platforms not just for development for also for the host game. If your game is targeted at any other platform you will not yet be able to use AwesomiumUnity.

Anderz000 commented 9 years ago

Thanks for the speedy reply!

After double checking everything and still having no luck, I thought I'd try it out in a blank new project, and it worked just fine. So there's obviously something in our pre-existing project blocking the script. It could be our Perforce version control. Could it be a "readonly" issue?

And yes, Windows is fine for what we need. Thanks!

bkeiren commented 9 years ago

That's quite strange. Maybe it is indeed some sort of rights issues, thought I wouldn't have a clue as to why this would be happening. As far as I know there should be no write access required (by AwesomiumUnity, maybe Awesomium itself does) by any of the DLL files except for simple log file writing. I would assume that if the issue was not being able to write to a log file we would be seeing a different error (or hopefully none at all).

I'm afraid for now I can't think of anything else to try except maybe check out all AwesomiumUnity-related files in Perforce and see if that solves the issues (because checking out should remove the read-only flag).

Anderz000 commented 9 years ago

Ok we managed to solve this issue. Turns out in the "/Assets/Plugin" folder, we had two folders: "x86" and "x86_64". These were created by uWebkit for a similar purpose (we're looking for an alternative to this product as it's quite buggy). It would seem, with these folders there, the root plugin folder is ignored, and Unity looks in the x86 and x86_64 folders for the dlls. So as soon as we put the dll in the x86 folder (Unity 4 being a 32bit editor), it worked just fine.

Thanks again for your help and for creating this git. Your integration shows a lot of promise! We're already noticing a lot of improvements over uWebkit. However, the lack of Javascript communication (we see in the code it's WIP) will mean we'll have to either continue to use/struggle with uWebKit and wait until that's a feature. Looking forward to it!

Features we'd like to see:

We'd very happily pay to use AwesomiumUnity if you can get most of these features integrated!

Thanks! :+1:

bkeiren commented 9 years ago

Thanks for the feedback! This is very valuable information.

I'd like to respond to the list of features that you mentioned:

In C#: WebView.BindJavaScriptCallback("MyFunction", SomeCSharpCallback);

In JavaScript: Unity.MyFunction();

In addition, it is possible to execute a string of JavaScript code from C# and receive callbacks to handle the various kinds of return values.

I hope this information provides some perspective,but if you have any more feedback, suggestions, questions, or anything else, please don't hesitate to let me know!

Cheers

sergipanadero commented 8 years ago

Hi, I have the same problem. I'm using Unity 5.2.3 32Bits version. I copied the files to UnityEditor Directory, and on Asset I tried copy AwesomiumUnity.dll on Plugins folder and on Plugins/x86 folder. On Play it works perfect. But when I build (x86) and run the application I have on Debug file this error.

`DllNotFoundException: C:/unity/Pruebas/Unity 5/Awesomium/release/awesomium_Data/Plugins/AwesomiumUnity.dll at (wrapper managed-to-native) AwesomiumUnityWebCore:awe_webcore_isrunning () at AwesomiumUnityWebCore.get_IsRunning () [0x00000] in :0 at AwesomiumUnityWebCore.EnsureInitialized () [0x00000] in :0 at AwesomiumUnityWebTexture.Initialize () [0x00000] in :0 at AwesomiumUnityWebTexture.Start () [0x00000] in :0

(Filename: Line: -1)`

Anyone can tell me what I'm doing wrong?

thanks you

bkeiren commented 8 years ago

@sergipanadero Hi! Since you mention that it works for you in play mode in the editor but not in a standalone build, can you verify that you've followed these first 2 steps for the standalone x86 build?

The thing is that you need to manually add the DLL and other required files to the folder as your x86 executable, because Unity does not do this for you automatically.

Let me know if that works!

JuliusNarvilas commented 7 years ago

I'm having the same issues with Unity editor working fine but the standalone build not rendering (I load a youtube video embed url and the audio comes through fine) Dis anyone find a solution for this?