How do I deal with DllNotFoundException ?

Hello folks,

I have included a package (the Google XR Cardboard to be exact) in my project, fully set up, fine. The sample scene has a script that needs to use the API from this package, but everytime I run it I’m getting a DllNotFoundException because it fails to locate a script that is located in the Packages folder.

I’m genuinely clueless on what to do. What is wrong here?

Thanks in advance.

2 Likes

Here’s a few things:

check the import settings on the DLL: is it in the right folder (probably Plugins/Android)? Is it flagged to go in the code? Is there a matching ABI for it (i.e., 64-bit if you’re building 64-bit), etc.?

also, attach adb logcat and see if there are any other runtime exceptions.

also, doublecheck the naming conventions for plugins. Ideally find some code that uses it and is known to work (another project) and study the details of how they did it.

Well, no. Everything is in Packages/Google Cardboard XR Plugin for Unity . I’m not sure if it is flagged to go in the code, how do I check it? How do I use this adb logcat? Also, there are no .dll files nor .abi. Apparently, everything relies on a single .cs file called api.cs . I don’t know man, Google did this.