Ask Your Question
2

Static initialization in tutorial_dnn_android openCV 3.4.3 [closed]

asked 2019-01-17 22:40:59 -0600

Paulslp gravatar image

updated 2019-01-18 02:44:26 -0600

berak gravatar image

How to use sample https://docs.opencv.org/3.4.2/d0/d6c/... without a manager? According to the instructions https://docs.opencv.org/master/d5/df8..., I added an SO-file to the opencv_mobilenet\ app\src\main\libs\armeabi folder, but the gradle gives an error when building. How to configure gradle so that it connects libraries from a SO-file or my error is different?

The graddle error is below

Execution failed for task ':app:compileDebugNdk'. Error: Your project contains C++ files but it is not using a supported native build system. Consider using CMake or ndk-build integration. For more information, go to: https://d.android.com/r/studio-ui/add... Alternatively, you can use the experimental plugin: https://developer.android.com/r/tools...

gradle file content

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "samples.opencv.org"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            jni.srcDirs = ['src/main/jniLibs']
        }
    }

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation project(':openCVLibrary343')
}
edit retag flag offensive reopen merge delete

Closed for the following reason not a real question by Paulslp
close date 2019-01-21 05:29:40.556917

1 answer

Sort by ยป oldest newest most voted
2

answered 2019-01-21 00:10:37 -0600

Paulslp gravatar image

updated 2019-01-21 00:11:27 -0600

The error disappeared after:

1) removing the code from build.gradle below. sourceSets { main { jni.srcDirs = ['src/main/jniLibs'] } }. 2) creating directory src/main/jniLibs without type "JNI folder". 3) copy SO-files to the "src / main / jniLibs" folder.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-01-17 22:40:59 -0600

Seen: 390 times

Last updated: Jan 21 '19