I'm trying to build a medium-size project in Eclipse. It consists of main app project and two Android libraries. Everything worked fine until I added a very simple JNI library to main project.
When I run the app on device I see this exception in LogCat:
01-11 17:19:01.421: E/AndroidRuntime(26569):at java.lang.Runtime.loadLibrary(Runtime.java:429) Couldn't load xxx: findLibrary returned null
I googled around for similar problems and I believe that I did everything correctly:
When I create a test project and link to the very same native code - it works fine. The problem persists in the main project. I already tried to create Eclipse project from scratch but it didn't help
I use Android SDK Tools v.16
Can anyone please help me with a suggestion?
Thanks!
Ok, after two days fighting the Android SDK I managed to solve my problem. Here's some explanation just in case it may help anybody else.
My previous project structure:
The original problem has been seen when I tried to load jni library in App2. I still don't understand what was preventing the runtime from finding the jni in the App2.
However the solution was to remove the Lib1 project from the workspace and add it as JAR file to Lib2 and both Apps. Now I'm finally able to use load the jni lib in the App2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With