android{}
sourceSets { //配置地址修改
main {
java.srcDirs = [‘src/main/java’]
aidl.srcDirs = [‘src/main/java’]
res.srcDirs = [‘src/main/res’]
manifest.srcFile ‘src/main/AndroidManifest.xml’
}
}
externalNativeBuild {
cmake {
path ‘src/main/jni/CMakeLists.txt’ //配置地址修改
}
}
4.5.2 project/build.gradle(APP_ABI)
gradle.afterProject { project ->
if (project.pluginManager.hasPlugin(‘com.android.application’)
|| project.pluginManager.hasPlugin(‘com.android.library’)
|| project.pluginManager.hasPlugin(‘com.android.test’)
|| project.pluginManager.hasPlugin(‘com.android.feature’) ) {
if (true) {
gradle.println(“Override build ABIs for the project ${project.name}”)
project.android {
splits {
abi {
enable true
universalApk false
//reset()
//include ‘armeabi-v7a’
//include ‘arm64-v8a’
//include ‘x86’
//include ‘x86_64’
}
}
}
}
if (true) {
gradle.println(“Override lintOptions for the project ${project.name}”)
project.android {
lintOptions {
// checkReleaseBuilds false
abortOnError false
}
}
}
// (you still need to re-build OpenCV with debug information to debug it)
if (true) {
gradle.println(“Override doNotStrip-debug for the project ${project.name}”)
project.android {
buildTypes {
debug {