DllNotFoundException: AwesomiumUnity
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)
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:
- Remove the DLL from your Plugins folder.
- (Re)start Unity
- Drag and drop the DLL into the Assets/Plugins folder in Unity. Don't just copy it over, actually drag and drop it. I'm not sure if this should or will have any effect, but it would not be such a stretch of the imagination to think that Unity has not (yet) properly recognised the DLL yet and is causing your in-editor runs of the game to not be able to load the DLL. I realise the readme does not mention any of this. This is because I've not seen this issue before so we may need to amend the readme file if we can solve it.
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.
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!
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).
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:
- Javascript messaging to/from (vital for our use case)
- Unity 4.6 UI integration example (we're currently attempting this)
- Containing the scripts within the project. I.e. Using the resources folder instead of manually having to place the process executables and dlls in Unity's editor folder and alongside the build
- Asset store/Plugin-like updates of the core scripts
- iOS/Android/Mac Support
We'd very happily pay to use AwesomiumUnity if you can get most of these features integrated!
Thanks! :+1:
Thanks for the feedback! This is very valuable information.
I'd like to respond to the list of features that you mentioned:
- JavaScript messaging: You can already bind C# functions to functions that you would call in JavaScript on the global 'Unity' object that AwesomiumUnity creates. Like so:
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.
- 4.6 UI integration: I've never attempted this, namely because 4.6 wasn't out when I started this project, but I may be able to look into this in the future.
- Relocating the dependencies and executables: I can see what I can do but due to the fact that all of the dependencies (except for AwesomiumUnity.dll) are loaded by Awesomium, I cannot promise anything as I don't have source access to Awesomium.
- Asset Store/Plugin like updates: I would love to put this up on the Asset Store, but because this is a wrapper around Awesomium I can't. The good folks at Awesomium just haven't provided the license that would allow this, unfortunately.
- iOS/Mac/Android support: Mac support (as well as Linux support) is something I would love to provide, but the situation is that I would need a Mac development machine for it, which I unfortunately don't have and can't afford. iOS/Android are two platforms that Awesomium doesn't support to begin with, so it's not possible for AwesomiumUnity to do so either, given the fact that it's built on top of it.
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
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
(Filename: Line: -1)`
Anyone can tell me what I'm doing wrong?
thanks you
@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!
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?