1、在mk文件中增加链接库
LOCAL_SHARED_LIBRARIES := \ libutilscallstack \
2、在对应cpp文件中修改代码
#include <utils/CallStack.h> ... android::CallStack stack; stack.update(); stack.log(LOG_TAG, ANDROID_LOG_ERROR, "stackdump:");