Ask Your Question

problem using cvBlobsLib with Android

asked 2013-01-06 17:31:46 -0500

noamiko gravatar image

updated 2013-01-07 16:39:08 -0500

Hi everyone, I am having problems using cvBlobsLib with my Android app. I am using Eclipse with NDK.

I have downloaded the library cvBlobsLib, compiled it successfully using eclipse and created the file libcvblobslib.a

When trying to use the libcvblobslib.a file in my project (in Eclipse), I am getting an error that says:

"Archive for required library: 'jni/cvblobslib_headers/libcvblobslib.a' in project 'MyProject' cannot be read or is not a valid ZIP file".

I cant figure out what the problem is... I added the libcvblobslib.a file to the build path, and all of the header files, together with the libcvblobslib.a are under the path jni/cvblobslib_headers/

I am able to use the openCV library without the cvBlobsLib, so I know that all the paths of the ndk are correct.

my is:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cvBlobsLib
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/cvblobslib_headers/
LOCAL_SRC_FILES := cvblobslib_headers/libcvblobslib.a

include $(CLEAR_VARS)
include ../../sdk/native/jni/
LOCAL_MODULE    := native_sample
LOCAL_SRC_FILES := jni_part.cpp 
LOCAL_LDLIBS +=  -llog -ldl

And my is :

APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a x86
APP_PLATFORM := android-11


edit retag flag offensive close merge delete


Hey Can you tell me which binary or archive you download for cvBlobLibs and how u made it shared library for Android? Thanks

himanshu jain gravatar imagehimanshu jain ( 2013-01-31 22:37:18 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-01-07 16:36:41 -0500

noamiko gravatar image

updated 2013-01-07 16:40:48 -0500

OK, I found a solution but it doesnt use the static library way. Instead, I copied the source files into my project and compiled them as a shared library.

The compilation takes some time now, but at least it works...

If someone knows how to do it statically I will be happy to know what am I missing...

edit flag offensive delete link more

Question Tools


Asked: 2013-01-06 17:31:46 -0500

Seen: 380 times

Last updated: Jan 07 '13