sh1r0 / caffe-android-demo

An android caffe demo app exploiting caffe pre-trained ImageNet model for image classification
https://github.com/sh1r0/caffe-android-lib
MIT License
255 stars 164 forks source link

Could not load library "libcaffe.so.1.0.0-rc3" needed by "/data/app/com.sh1r0.caffe_android_demo_1_garbage-1/lib/arm64/libcaffe_jni.so"; caused by library "libcaffe.so.1.0.0-rc3" not found #15

Closed g1910 closed 8 years ago

g1910 commented 8 years ago

Hi

I am trying to test the caffe-android-demo app, but it's giving me this error. Any idea what's the root cause for this?

03-26 20:21:53.548 6416-6416/? E/art: dlopen("/data/app/com.sh1r0.caffe_android_demo_1_garbage-1/lib/arm64/libcaffe_jni.so", RTLD_LAZY) failed: dlopen failed: could not load library "libcaffe.so.1.0.0-rc3" needed by "/data/app/com.sh1r0.caffe_android_demo_1_garbage-1/lib/arm64/libcaffe_jni.so"; caused by library "libcaffe.so.1.0.0-rc3" not found 03-26 20:21:53.548 6416-6416/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.sh1r0.caffe_android_demo_1_garbage, PID: 6416 java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libcaffe.so.1.0.0-rc3" needed by "/data/app/com.sh1r0.caffe_android_demo_1_garbage-1/lib/arm64/libcaffe_jni.so"; caused by library "libcaffe.so.1.0.0-rc3" not found at java.lang.Runtime.loadLibrary(Runtime.java:371) at java.lang.System.loadLibrary(System.java:989) at com.sh1r0.caffe_android_demo.MainActivity.<clinit>(MainActivity.java:147) at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.Class.newInstance(Class.java:1572) at android.app.Instrumentation.newActivity(Instrumentation.java:1065) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2204) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5234) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)

sh1r0 commented 8 years ago

@g1910 Please refer to https://github.com/sh1r0/caffe-android-lib/issues/30#issuecomment-192776929. Thanks.

rivaldo4t commented 8 years ago

@g1910, did you get the solution for this error? Stuck on it.

g1910 commented 8 years ago

Strange that when I pulled the latest changes to the repo and build the library with my changes in it, it was working fine with no such errors. However, there were other errors which followed. The app is randomly crashing giving no error logs and I suspect it is the native binaries. Can it be due to memory or other related issues?

sh1r0 commented 8 years ago

@g1910 @rivaldo4t I guess that libcaffe.so is a soft link to libcaffe.so.1.0.0-rc3 in your cases, right? Could you please provide the information about your build environment (OS, NDK, etc.) and targeted android abi in detail? Thanks.

rivaldo4t commented 8 years ago

I am using Ubuntu 14.04.2 LTS and android-ndk-r10e as specified

sh1r0 commented 8 years ago

@rivaldo4t Could you provide your cmake version as well? Since I use Ubuntu 14.04 with android-ndk-r10e and cmake 3.3.2, and everything is fine. Thanks.

rivaldo4t commented 8 years ago

I am using cmake version 2.8.12.2

sh1r0 commented 8 years ago

@rivaldo4t I recommend you to upgrade your cmake, as I met some issues when using the old version of cmake before.

rivaldo4t commented 8 years ago

@sh1r0, Thanks for the persistent assistance. I got it to work finally.

The problem was not with any of this. I just recently (after you told me to build caffe-android-lib from dev branch) switched my device to try the build libs on; which was not compatible with the build server. I switched my device back to the compatible one and it worked. Silly, I know. Thanks anyway.

sh1r0 commented 8 years ago

@rivaldo4t :+1: Good to know.