借鉴这个博客https://blog.csdn.net/sbsujjbcy/article/details/49520791
问题记录如下:
1.编译的时候报错:Error:(81) Android NDK: Application targets deprecated ABI(s): armeabi
在Application.mk中去掉armebi,成为下面这句就可以了
APP_ABI := armeabi armeabi-v7a 改成 APP_ABI := armeabi-v7a
2.Error:Execution failed for task ':app:ndkBuild'.
> Process 'command 'D:\Cpanfile\androidStudioSDK\ndk-bundle/ndk-build.cmd'' finished with non-zero exit value 2
问题解决是因为没有将jni文件正确编写,以及android.mk找不到对应cpp文件导致的
3.生成jni头文件:cd project/app/main/java ;
javah -d ../jni -jni com.excellence.opencvtest.OpenCVHelper 就会在jni目录生成一个头文件