0

I have working project where I use JNI to call methods from C library.

My project's structure:

enter image description here

And code which load library:

static {
    System.loadLibrary("RemoveBackground");
}

It works good. But until I try to integrate this functionality in other project. I copied jni and libs folders. Also all three classes without RemoveBackgroundActivity (test activity). And when I compiled this project I have an exeption:

1663-1663/com.example.Activities E/dalvikvm﹕ The lib may be ARM... trying to load it [/data/data/com.example.Activities/lib/libRemoveBackground.so] using houdini
1663-1663/com.example.Activities E/dalvikvm﹕ dvmHoudiniDlopen returns 0x9833cf40 with bool=1

Do you know how to solve the problem or some other way to do this?

Val
  • 4,225
  • 8
  • 36
  • 55
  • 1) I'm not sure about IDEA, but in Eclipse you have to enable native development in the project. You can't just copy the directory. 2) I doubt you needed the libs directory unless you are linking other libraries. Part of me thinks it's trying to load the library built in the other project. 3) what's in Application.mk? It's usually not necessary. 4) Unless you are registering native methods explicitly, the JNI calls will probably need updating because of the package name (that may be a future issue, though). – Dave Dec 04 '13 at 13:10

1 Answers1

0

I suppose that the RemoveBackground.so native library you try to use wasn't built for ARM architecture. I'm not sure about Linux, but on Mac OS X you can check the supported architectures of a native library using lipo command. For example:

lipo -info /usr/lib/RemoveBackground.so
Vladimir
  • 1
  • 1
  • 23
  • 30