Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Restarting Unity does not work
#1
I purchased this asset a month or so ago, and have imported it into a few different projects with no success. I continue getting the DllNotFoundException for libOni, despite restarting Unity multiple times. Is there something special I need to do to install this besides importing the asset into my project?

I am using Unity version 2019.3.0f1 on Manjaro Linux with Obi Fluid version 5.3.
Reply
#2
(19-05-2020, 03:06 PM)pastblasters Wrote: I purchased this asset a month or so ago, and have imported it into a few different projects with no success. I continue getting the DllNotFoundException for libOni, despite restarting Unity multiple times. Is there something special I need to do to install this besides importing the asset into my project?

I am using Unity version 2019.3.0f1 on Manjaro Linux with Obi Fluid version 5.3.

Hi there,

The editor under certain Linux distros has issues recognizing the native library, and has been reported by other users. Haven't determined why yet. Ubuntu and Mint seem to work fine, can't talk about others.

Standalone builds using the exact same library run fine in all distros though, so it is a editor-only issue and probably a bug in Unity. Is it possible for you to develop in another distro/OS, or is this your only development machine?
Reply
#3
(19-05-2020, 05:15 PM)josemendez Wrote: Hi there,

The editor under certain Linux distros has issues recognizing the native library, and has been reported by other users. Haven't determined why yet. Ubuntu and Mint seem to work fine, can't talk about others.

Standalone builds using the exact same library run fine in all distros though, so it is a editor-only issue and probably a bug in Unity. Is it possible for you to develop in another distro/OS, or is this your only development machine?

After doing some research, I was actually able to fix this by editing Obi.cs (still having some issues with the particle shader, but thats almost certainly because I'm using URP, though I was able to update all of the relevant materials fairly easily). I added to the preprocessor directives to test for UNITY_EDITOR_LINUX before all of the DllImport declarations so that it also uses LIBNAME "Oni" as well instead of "libOni":

   #if (UNITY_IOS && !UNITY_EDITOR)
       const string LIBNAME = "__Internal";
   #elif ((UNITY_ANDROID || UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX) && !UNITY_EDITOR)
       const string LIBNAME = "Oni";
   #else
       const string LIBNAME = "libOni";
   #endif
Reply
#4
(21-05-2020, 04:01 PM)pastblasters Wrote: After doing some research, I was actually able to fix this by editing Obi.cs (still having some issues with the particle shader, but thats almost certainly because I'm using URP, though I was able to update all of the relevant materials fairly easily). I added to the preprocessor directives to test for UNITY_EDITOR_LINUX before all of the DllImport declarations so that it also uses LIBNAME "Oni" as well instead of "libOni":

   #if (UNITY_IOS && !UNITY_EDITOR)
       const string LIBNAME = "__Internal";
   #elif ((UNITY_ANDROID || UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX) && !UNITY_EDITOR)
       const string LIBNAME = "Oni";
   #else
       const string LIBNAME = "libOni";
   #endif

Hi,

Thanks for finding and sharing this! using your fix though, it actually triggers the DllNotFound exception in my test machine. Could be that in some cases the lib- prefix is needed, while in others it isn't. Will investigate further.
Reply
#5
(21-05-2020, 04:17 PM)josemendez Wrote: Hi,

Thanks for finding and sharing this! using your fix though, it actually triggers the DllNotFound exception in my test machine. Could be that in some cases the lib- prefix is needed, while in others it isn't. Will investigate further.

Maybe better to give it its own test:
   #elif (UNITY_EDITOR_LINUX)
       const string LIBNAME = "Oni";


Might be inconsistencies in how the preprocessor checks for Linux depending on the distro.
Reply