问题描述:
移植别人的项目时将yolov5拷贝到我的项目中时java和c++找不到连接,上方提示 This file is not part of the project Please include it in the appropiate build file(build.gradle,CMakeLists.txt or Android.mk etc.) and sync the proiect 。cpp文件也无法通过ctrl+鼠标点击找到定义
解决方法:
在build.gradle(:app)中添加
android {
externalNativeBuild {
cmake {
version "3.10.2"
path file('src/main/jni/CMakeLists.txt')
}
}
}