libandroid-opencv.so cannot be loaded (Bug #878)
Description
While running the OpenCV_SAMPLE application with the AVD (android-7) I get the attached LogCat messages and the application dies.
It hangs up at the same moment when run at the Samsung Galaxy S device:
DEBUG/dalvikvm(267): Trying to load lib /data/data/com.OpenCV_SAMPLE/lib/libandroid-opencv.so 0x43d0c048
Associated revisions
Merge pull request #878 from apavlenko:better_glue_search
History
Updated by Pawel Kies about 14 years ago
I use the AndroidExperimental branch.
The issue is similar to the #789 one.
Updated by Ethan Rublee about 14 years ago
Please verify that the libandroid-opencv.so exists in your apk. Look at the apk with an archive manager, and you should see the libOpenCV_SAMPLE.so and libandroid-opencv.so in there. If not, something is amiss with your building steps.
With cmake, and the ndk you must build the following:- opencv for android
- the android-opencv project
- OpenCV_SAMPLE
The android sdk will auto grab any libraries from the android-opencv project. Meaning, if there are shared objects under the android-opencv/libs/armeabi* folders, it will copy them into the final apk.
Also - please do not attempt to run these on the AVD ( they will not work ). This may be the issue, as I think you must compile for armeabi, instead of armeabi-v7a to work on the emulator. The camera and opengl with give you trouble on the AVD. Please run on a real device, the AVD is not supported for the live camera apps.
The AVD should however be fine when running apps that do not use opengl 2.0, or armeab-v7a...
Updated by Pawel Kies about 14 years ago
I mentioned that the same issue appears also on the Samsung Galaxy S device but the LogCat messages are less detailed. The same applies to the CVCamera application.
I built these three targets you mentioned, and I receivedtwo files in the
OpenCV_SAMPLE.apk\lib\armeabi
directory:
libandroid-opencv.so
libOpenCV_SAMPLE.so
You can find a similar/the same issue at:
http://code.google.com/p/android-opencv/issues/detail?id=7
It is interesting that one of the commenters solved this issue by changing the way of linking the OpenCV libraries. Maybe you could propose such workaround for the cmake build, please. It could be very helpful for me.
Updated by Ethan Rublee about 14 years ago
See the opencv/OpenCVConfig.cmake.in line 60
You can change the linker order there and then rebuild for android. To rebuild
cd android/build cmake . make
Updated by Ethan Rublee almost 14 years ago
I will close this report. If the issue is still valid you may reopen with details.
- Status changed from Open to Done
- (deleted custom field) set to fixed
Updated by Kirill Kornyakov almost 13 years ago
- Target version set to 2.3