If the C language file of Android JNI requires ADB, the following two lines are required:
# Define log_tag "mytag"
# Include <cutils/log. h>
If the header file cutils/log. h cannot be found, add the following line to the Android. mk file in the JNI/directory of your project:
Local_cflags + =-I ~ /Android-2.0/system/CORE/include
Or:
Directly copy the cutils directory under the Android-2.0/system/CORE/include directory to the "ndk/build/platforms/Android-3/common/include" directory.
If the log library cannot be found when the link is prompted (that is, the liblog. So library cannot be found), add the following line to the Android. mk file in the JNI/directory of your project:
Local_ldlibs: =-L $ (sysroot)/usr/lib-llog
$ (Sysroot)/usr/lib is equivalent to build/platforms/Android-3/arch-mipso32/usr/lib (this is the directory under ndk ).
And copy the liblog. So file to the "build/platforms/Android-3/arch-mipso32/usr/lib" directory.