Workaround:
1. Check the definition of native C code:
JNIEXPORT void Java_com_example_something_MyClass_getMyString(JNIEnv * env, jobject obj) {
Where:com_example_something is the decomposition of the package name,MyClass is the class that calls the. so
2. Check if. So is loaded into the system:
ADB Shell Ls-l/data/data/com.example.something/lib/
3. Assume that Lib is libtest.so
Copy the file into the Libs directory, calling the code:
Static
{
System.loadlibrary ("test");//Note there is no prefix lib, corresponding to Local_module
}
Attached: typical ANDROID.MK
[HTML]View PlainCopy
- local_path := $ (call My-dir)
-
- include $ (clear_vars)
-
- local_module := TEST  
- local_src_files := mytest.c
-   
- include $ (build_shared_library)
JNIEXPORT void Java_com_example_something_MyClass_startServer(JNIEnv * env, jobject obj) {
Where:com_example_something is the decomposition of the package name,MyClass is the class that calls the. so
"Go" android:no implementation found for native