在Android Studio中不显示依赖关系中的OpenCV模块 [英] Showing no OpenCV module in dependancies in Android Studio

查看:190
本文介绍了在Android Studio中不显示依赖关系中的OpenCV模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了许多教程和博客,以在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"安卓 {编译版本28buildToolsVersion"28.0.3";defaultConfig {//applicationId"org.opencv"}buildTypes {释放 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.txt'}}} 

apply plugin:'com.android.application'更改为 apply plugin:'com.android.library'

并注释掉以下行:

applicationId"org.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

OpenCV in 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆