Android Question Native lib missing from apk

warwound

Expert
Licensed User
Longtime User
Hi all.

I have taken an old Eclipse JNI project, converted it into an Android Studio project, modified the C code and then tested it in an Android Studio test project - it works perfectly.

Next i wrapped the new JNI project into a b4a library, tested and got nothing but an UnsatisfiedLinkError, android cannot find my native library file libRfm73Streams.so:


I'm compiling my wrapper using SLC and have a directory structure:

project-folder\additional\lib\armeabi-v7a\libRfm73Streams.so
project-folder\src\ <my classes here>

(armeabi-v7a is the only CPU architecture that i need to support, i use many other native libraries and the 'armeabi-v7a' variant is the one i always use on our custom android tablets).

SLC compiles my project and the library .jar contains:
<jar root folder>\lib\armeabi-v7a\libRfm73Streams.so

B4A compiles my test project and it throws the UnsatisfiedLinkError when started.
A quick check in the compiled .apk file shows no lib folder and no native library file.

So why isn't b4a compiling the library into the apk?

A forum search showed a similar problem from another member and the problem was caused by a mismatch of java package name in the native wrapper class - it didn't match the C function names.
Now i did refactor my library wrapper package name and C function names, i assume i have done this correctly as a test project in Android Studio worked fine.

How can i debug this problem?

Thanks.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…