个人记录
SKD 7.0 以后使用串口serialport so库需要重新编译,不然会有提示弹出,解决方式重新编译最新so库。
https://github.com/cepr/android-serialport-api github下载地址 jni 文件
通过studio重新编译 so库
通过以上链接下载找到 SerialPort.c SerialPort.h 两个文件,然后再项目中创建一个jni目录,将这两个文件放进去
然后创建一个 Native C++ 新项目只为了拿 CMakeLists.txt 文件。
复制CMakeLists.txt 文件到自己的项目中 如下图
打开CMakeLists.txt 修改如下图几个地方
在项目中的 build.gradle 添加如图下
然后重新编译就会生成最的SO库了 ,下图就是重新编译后的so库
原文转载自:https://blog.csdn.net/oliverzyh/article/details/106336699