Monophonic Android version of Monoroid DllNotFoundException

I am trying to get a Native C / C ++ library working with Monodroid in an emulator using DllImport. I am developing mainly in Windows / Visual Studio 2010.

I built my own C / C ++ library (ZeroMQ) using the Android NDK tools, both on x86 and armeabi platforms, using the Ubuntu virtual machine. Is this correct - x86 for emulator and armeabi for real device? (This certainly applies to the iPhone / MonoTouch - although in this case the statically linked file libzmq.a and DllImport __Internal)

I added the x86 version of libzmq.so to my MonoDroid project in the lib \ x86 \ libzmq.so directory structure

When I first tried to build / deploy the simulator, I got the error "I can’t determine the type of abi", so I added x86 to the AndroidNativeLibrary project element group Include = "lib \ x86 \ libzmq.so">, Then it is deployed.

I have a DllImport for a function to call [DllImport ("libzmq"

I tried libzmq.so, lib / x86 / libzmq, lib / x86 / libzmq.so, etc., but then I call the DllImported method (works in the emulator), I always get a DllNotFoundException exception.

Can someone give me some direction?

EDIT: after reading another support answer that says the emulator uses armeabi.so libraries, I removed x86 / libzmq and added lib / armeabi / libzmq.so as AndroidNativeLibrary. I also deleted the Abi project file entry, and indeed, the project was built and deployed perfectly.

, DllNotFoundException, DllImported. ?

+2
3

, , , ! - ZeroMQ , / NDK r7. http://www.zeromq.org/build:android NDK r6. NDK r5b ( , ) ZeroMQ, . , !

0

( ZeroMQ).

Mono. , Mono/MonoDevelop, , , ARM, x86/x64/Any CPU.

, P/Invoke interop , x64, x86 .

clrzmq Mono libzmq, ARM . x86 x64.

0

Source: https://habr.com/ru/post/1536121/


All Articles