Working with openCV in the new Android Studio 3.4?

原文: https://stackoverflow.com/questions/55835542/working-with-opencv-in-the-new-android-studio-3-4


 

Same problem for me, the Add Module Dependency pop up says "Nothing to show", so I edited the files manually. In this beginner's guide https://android.jlelse.eu/a-beginners-guide-to-setting-up-opencv-android-library-on-android-studio-19794e220f3c instead of step 5, edit these files as follow :

settings.gradle :

include ':app'
include ':opencv'

(where opencv is the name of the library you gave at step 3, screenshot 4)

In file gradle.properties (Module: opencv)

Replace line

apply plugin: 'com.android.application'

By:

apply plugin: 'com.android.library'

Remove line:

applicationId "org.opencv"

In the end it, this file looks like this :

apply plugin: 'com.android.library'
android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    defaultConfig {
        minSdkVersion 24
        targetSdkVersion 28

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
}

In file gradle.properties (Module: app)

Add the following line in the dependencies section :

implementation project(':opencv')

Then resume at step 6 of the beginner's guide.

posted @ 2019-06-06 16:26  柠檬雨  阅读(154)  评论(0)    收藏  举报