Ask Your Question
0

libopencv_java cannot be loaded anymore

asked 2014-03-15 22:26:38 -0600

Hello! I have a strange issue. I am using android-ndk-r9c and OpenCV 2.4.8 on Mac. I developed an application and tested it on Samsung Galaxy Note. When I tried to run on Nexus 4, the "Couldn't load opencv_java: findLibrary returned null" appeared. I tried many things but it seems that "OPENCV_INSTALL_MODULES:=on" does not integrate OpenCV into my app. I was following these instructions. After some googling and changing some things and reverting back I discovered that the same error is issued also when I tried to run again on the Galaxy Note... So now my app is not running anywhere, neither on emulator. I am desperate. Your help is highly appreciated!! Thank you!!!

Android.mk :

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

OPENCV_INSTALL_MODULES:=on

include /Users/user/Tihomir/CPP_libs/OpenCV-2.4.8-android-sdk/sdk/native/jni/OpenCV.mk

LOCAL_SHARED_LIBRARIES := opencv_java

LOCAL_MODULE := operations

LOCAL_LDLIBS += -llog

LOCAL_SRC_FILES := operations.cpp

include $(BUILD_SHARED_LIBRARY)

and respectively, Application.mk :

APP_STL := gnustl_shared

APP_CPPFLAGS := -frtti -fexceptions

APP_ABI := all

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-03-16 10:07:32 -0600

updated 2014-03-16 10:08:12 -0600

*.apk file is just a zip archive. You can extract it and check is there libopencv_java.so or not.

edit flag offensive delete link more

Comments

Thank you!! I see in Eclipse that libopencv_java is not copied to /libs. And my liboperations is copied instead.

Any way. Now my problem is different. Somehow "OPENCV_INSTALL_MODULES:=on" started to copy libopencv_java in /libs but when I put this line in Android.mk, there are errors from my liboperations which come from OpenCV and not from my code. Here is one:

/Users/user/Android_NDK/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi-v7a/objs/operations/operations.o: in function cv::Mat::release():/Users/user/Tihomir/CPP_libs/OpenCV-2.4.8-android-sdk/sdk/native/jni/include/opencv2/core/mat.hpp:367: error: undefined reference to 'cv::Mat::deallocate()'

tihomirski gravatar imagetihomirski ( 2014-03-16 11:16:46 -0600 )edit

Remove LOCAL_SHARED_LIBRARIES := opencv_java line from your Android.mk.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2014-03-17 02:32:48 -0600 )edit

@tihomirski , You was able to solve this problem? I searched everywhere and tried various combinations but nothing works.

Julio Nogueira gravatar imageJulio Nogueira ( 2014-03-31 08:33:39 -0600 )edit

Question Tools

Stats

Asked: 2014-03-15 22:26:38 -0600

Seen: 1,117 times

Last updated: Mar 16 '14