个人记录

SKD 7.0 以后使用串口serialport  so库需要重新编译,不然会有提示弹出,解决方式重新编译最新so库。

https://github.com/cepr/android-serialport-api  github下载地址 jni 文件

通过studio重新编译 so库

通过以上链接下载找到  SerialPort.c     SerialPort.h 两个文件,然后再项目中创建一个jni目录,将这两个文件放进去Android串口(android-serialport-api )studio 编译 so库

然后创建一个 Native C++ 新项目只为了拿 CMakeLists.txt 文件。

Android串口(android-serialport-api )studio 编译 so库

复制CMakeLists.txt 文件到自己的项目中 如下图

Android串口(android-serialport-api )studio 编译 so库

打开CMakeLists.txt  修改如下图几个地方

Android串口(android-serialport-api )studio 编译 so库

在项目中的 build.gradle 添加如图下

Android串口(android-serialport-api )studio 编译 so库

然后重新编译就会生成最的SO库了 ,下图就是重新编译后的so库

Android串口(android-serialport-api )studio 编译 so库

 

相关文章:

  • 2021-09-17
  • 2021-10-16
  • 2021-12-05
  • 2022-12-23
  • 2022-01-16
  • 2022-01-15
  • 2021-05-18
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2021-04-17
  • 2021-05-31
  • 2021-09-08
  • 2021-09-30
  • 2022-12-23
相关资源
相似解决方案