安卓引入opencv问题
NOTE : If you get error like “Namespace not specified. Please specify a namespace in the module’s build.gradle file” Add this line in build.gradle file of opencv sdk.
报错:“Namespace not specified. Please specify a namespace in the module’s build.gradle file”
解决:在opencv-sdk中的 build.gradle添加如下
报错:类似这种的
Execution failed for task ':opencv:compileDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
解决:在opencv-sdk中的 build.gradle添加如下
//solution
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
报错:类似这种的,告诉你opencv-sdk中的某个模块用不了了
package org.opencv.engine does not exist
import org.opencv.engine.OpenCVEngineInterface;
cannot find symbol
protected OpenCVEngineInterface mEngineService;
^
symbol: class OpenCVEngineInterface
location: class org.opencv.android.AsyncServiceHelper
解决:
参考: link