在 Android Studio 中的依赖项中未显示 OpenCV 模块 [英] Showing no OpenCV module in dependancies in Android Studio
问题描述
我尝试了很多关于在 Android Studio 上设置 OpenCV Android 库的教程和博客其中一些在这里
好的,导入名为 java 的模块后,我们必须添加依赖项,但在 添加模块依赖项 中未显示任何模块名称 java 或任何内容
任何人都知道我如何解决这个问题或在 Android studio
OpenCV
配置的任何正确步骤我正在使用
Android Studio -4.0
opencv-4.3.0-android-sdk
第一张截图:Android Studio 可能在新版本中删除了该选项.
第二个截图:您可以通过编辑 Opencv 的 build.gradle 来解决问题,如下所示:
应用插件:'com.android.library'安卓 {compileSdkVersion 28buildToolsVersion "28.0.3";默认配置{//applicationId "org.opencv";}构建类型{释放 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'}}}
将应用插件:'com.android.application'更改为应用插件:'com.android.library'
并注释掉以下行:
applicationIdorg.opencv"
I tried many tutorials and blogs for Setting up OpenCV Android Library on Android Studio some of them are here
A Beginner’s Guide to Setting up OpenCV Android Library on Android Studio
Add OpenCV library into Android Studio
but i am unable to configure it according to above solutions
at start when i try to import module from /OpenCV-android-sdk/sdk/java
android studio not showing module name edit box and hence i have to add "java" as a OpenCV
module name
OK after importing module with the name of java we have to add dependencies but in add module dependencies not showing any module name java or anything
Guys anyone know how can i resolve this issue or any proper steps for OpenCV
configuration in Android studio
I am using
Android Studio -4.0
opencv-4.3.0-android-sdk
First Screenshot: Android Studio may have removed that option in new version.
Second Screenshot: You can solve issue by editing build.gradle of Opencv as below:
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
//applicationId "org.opencv"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
Change apply plugin: 'com.android.application' to apply plugin: 'com.android.library'
and comment out the following line :
applicationId "org.opencv"
这篇关于在 Android Studio 中的依赖项中未显示 OpenCV 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!