vulovicv23 / opencv-documentscanner-android

Using opencv library, example of connecting project to c++ code and performing document scanning
Apache License 2.0
30 stars 17 forks source link

NDK Compilation error. #1

Open sayantans3 opened 7 years ago

sayantans3 commented 7 years ago

**Error:(198) * Android NDK: Aborting... . Stop. and Error:Execution failed for task ':app:ndkBuild'. Process 'command finished with non-zero exit value 2

below is my app level build.gradle Please give a solution

`apply plugin: 'com.android.application import org.apache.tools.ant.taskdefs.condition.Os

android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "prisca.ctest" minSdkVersion 21 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { cppFlags "-frtti -fexceptions" abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips', 'mips64' } } }

sourceSets.main {
    jniLibs.srcDir 'src/main/libs' //set .so files directory to libs
    jni.srcDirs = [] //disable automatic ndk-build call
}

// call regular ndk-build(.cmd) script from app directory
task ndkBuild(type: Exec) {
    Properties properties = new Properties()
    properties.load(project.rootProject.file('local.properties').newDataInputStream())
    def ndkDir = properties.getProperty('ndk.dir')
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine "$ndkDir/ndk-build.cmd", '-C', file('src/main').absolutePath
    } else {
        commandLine 'ndk-build', '-C', file('src/main').absolutePath
    }
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn ndkBuild
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
externalNativeBuild {
    cmake {
        path "CMakeLists.txt"
    }
}

}

dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.2.0' compile "com.android.support:support-v4:25.2.0" compile "com.android.support:support-v13:25.2.0" compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4' testCompile 'junit:junit:4.12' compile project(':openCVLibrary320')

compile 'com.github.chrisbanes:PhotoView:1.3.1'

} `

vulovicv23 commented 7 years ago

@sayantans3 What Android Studio version are you using?

sayantans3 commented 7 years ago

I'm using Android Studio Version 2.3.1

asbadve commented 7 years ago

Hey @vulovicv23 Any fix on this? @sayantans3 Did you find the solution.

sayantans3 commented 7 years ago

@asbadve not yet. Found another useful library.

asbadve commented 7 years ago

@sayantans3 which one?

aurelio0rs1araujo commented 7 years ago

@asbadve this program is working for me. the only thing that does not work is the auto focus.

vulovicv23 commented 6 years ago

Sorry guys, I'm not maintaining this project anymore.

zakblacki commented 5 years ago

Remove theses

armeabi', 'mips', 'mips64'