- Home /
Native c++ plugin on android
Hello Everyone, I have problem with using Native c++ on Android device. It's simply showing dllnotfoundexception when debugging with ADB. I try every combination of .dll path (Plugins, Plugins/Android, Root Folder, Library Folder etc) I try different compiling options Net.2.0 and subset. It's working perfect on Windows and Editor. Library is not being load in project, i am using standard command dllimport and it shows error message. It looks like Library it's not being compiled into project. I export this to Google Android Project and compile there, but it's still the same. Library is not .net and i don't have access to edit source code i was trying to decompile but its not being read by .net reflector etc. Is it still possible somehow to use this file with Android device, like asset or something.
Yes in Unity there is function [DllImport("PluginName")] I already read that: "A very simple native library with a single function might have source code that looks like this:
float FooPluginFunction () { return 5.0F; } "
I cannot edit source code of native library i cannot even read source code. [DllImport ("PluginName")] give me always dllnotfoundexception.
Here's another manual page (Beats me why they aren't all together in the manual):
http://docs.unity3d.com/$$anonymous$$anual/PluginsForAndroid.html
And one guy was simply using the wrong files.
Have you trawled Google on this? Would be useful to know what you have actually tried.
Oh yes, and theres this
32-bit native plugins will not work in the 64-bit editor. Attempting to load them will result in errors being logged to the console and exceptions being thrown when trying to call a function from the native plugin.
To continue to use 32-bit native plugins in the editor, use the 32-bit editor version (provided as a separate installer).
Not sure this is causing the issue on build?
Well it's 32 bit and its working in editor. Editor and PC it's not a case :) Building a Plugin for Android it's not a case as well. I need to use already created library in Android(I don't have source code, i cannot read and edit with any decompiler). I know what methods i need to call from this library but it's working only on Windows build and in Editor. This guides will be related if this libraries can be opened or edited. btw. i google this before posting here but thx for try anyway :) I am just thinking that compiler is not compiling this .dll