Reputation: 527
I have a project with 3 modules - a library and 2 apps that using this library. Now I want to add native-lib (one c file) into the library module, and use it in one of the library classes. I'm new to NDK so I followed the Google guide and created new project with NDK support and it works fine. Then I copy the cpp directory, CMakeList, and kept the correct structure of the project. Now, what happening is that the project compiles successfully, but crashes when I trying to call the native func from java class. Exception: Method threw 'java.lang.UnsatisfiedLinkError' exception.
Upvotes: 4
Views: 953
Reputation: 523
I had this exception with a subsequent ClassNotFoundException
when I wrote a Java library that referenced other native libraries. I didn't use NDK like you did, but maybe these steps (that solved it for me) can provide you some new ideas:
/build/outputs/aar/
)Upvotes: 2