EmguCV cvextern System.DllNotFoundException

Post your Android related questions here.
Post Reply
Posts: 1
Joined: Mon Sep 05, 2016 2:41 pm

EmguCV cvextern System.DllNotFoundException

Post by fdfey » Mon Sep 05, 2016 2:45 pm

When im running my application im getting this error "EmguCV cvextern System.DllNotFoundException". In desktop i must create the folders x86 and x64 and put the dll into then, but when im using Android (with Xamarin) what must i do?

PS: i'm using Demo license.

System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception. ---> System.DllNotFoundException: cvextern
at (wrapper managed-to-native) Emgu.CV.CvInvoke:RedirectError (Emgu.CV.CvInvoke/CvErrorCallback,intptr,intptr)
at Emgu.CV.CvInvoke..cctor () [0x0008c] in <filename unknown>:0
--- End of inner exception stack trace ---
at Emgu.CV.Image`2[TColor,TDepth].AllocateData (Int32 rows, Int32 cols, Int32 numberOfChannels) [0x00013] in <filename unknown>:0
at Emgu.CV.Image`2[TColor,TDepth].set_Bitmap (Android.Graphics.Bitmap value) [0x0003a] in <filename unknown>:0
at Emgu.CV.Image`2[TColor,TDepth]..ctor (Android.Graphics.Bitmap bmp) [0x00006] in <filename unknown>:0
at EmguCVTeste.ImageProcessing.Process (Android.Graphics.Bitmap imageToProcess) [0x00002] in d:\TCC * *\App2\App2\ImageProcessing.cs:28

Site Admin
Posts: 1011
Joined: Thu Feb 28, 2008 4:16 pm

Re: EmguCV cvextern System.DllNotFoundException

Post by canming » Thu Sep 08, 2016 8:16 am

The demo license from the Xamarin Component Store only support running on x86 architecture. Please make sure you are using the x86 android emulator or x86 device, otherwise there will be a DllNotFoundException. The full version do not have this restriction.


Posts: 3
Joined: Wed Jun 29, 2016 10:51 pm

Re: EmguCV cvextern System.DllNotFoundException

Post by ppsupport » Fri Nov 17, 2017 3:35 am

Also received this error while using a EMGU 3.1 build on new box.

to see what issue was, i ran ldd on cvextern_test:
tc@conway:~$ ldd `which cvextern_test`
linux-gate.so.1 (0xb77e9000)
libcvextern.so => not found
The fix was that for some reason the libcvextern.so library had been placed in /usr/local/bin rather than LD_LIBRARY path of /usr/local/lib.

simply copied the file to new location and that solved the issue:
tc@conway:~$ sudo cp /usr/local/bin/libcvextern.so /usr/local/lib/
tc@conway:~$ ldd `which cvextern_test`
linux-gate.so.1 (0xb7771000)
libcvextern.so => /usr/local/lib/libcvextern.so (0xb6660000)
tc@conway:~$ cvextern_test
Test cvPoint3D64f cross product: Passed
Test mulS: Passed
Test quaternions slerp: Passed
Test quaternions inverse: Passed
Template matched expected: 39,123; computed: 39,123
Size of CvSize (expected 8): 8
Size of CvPoint2D32f (expected 8): 8
Size of CvRect (expected 16): 16
(I did not experience this problem when building from 3.3 makefiles, so i expect it's been corrected)

Post Reply