问题

build command failed
当调用__android_log_print(ANDROID_LOG_ERROR …)时

因为so文件没有没有添加log的链接库

解决方法

在CMakeList.txt中

# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.

target_link_libraries( # Specifies the target library.
                        hello-jnicallback
                       # Links the target library to the log library
                       # included in the NDK.
                       log ) // 添加log链接库

参考

undefined reference to `__android_log_print’
https://blog.csdn.net/niuba123456/article/details/80992276

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐