Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with FaceRecognizer- SIGSEGV #454

Closed
manav95 opened this issue Jul 9, 2016 · 1 comment
Closed

Issue with FaceRecognizer- SIGSEGV #454

manav95 opened this issue Jul 9, 2016 · 1 comment

Comments

@manav95
Copy link

manav95 commented Jul 9, 2016

So I am trying to use FaceRecognizer with Android. The code compiles and it seems to be locating the method, but I am getting the following error when I try running the line:

FaceRecognizer faceRecognizer = createFisherFaceRecognizer();

Here is the tombstone
07-09 16:23:24.973 28399-28399/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xffffffff 07-09 16:23:25.033 28399-28399/? A/DEBUG: r0 ffffffff r1 00000001 r2 b6facb9c r3 b6facb3c 07-09 16:23:25.033 28399-28399/? A/DEBUG: r4 00000001 r5 ffffffff r6 ae2b839c r7 ae2bff14 07-09 16:23:25.033 28399-28399/? A/DEBUG: r8 b6fac6fc r9 00000012 sl b5746004 fp b6fa5662 07-09 16:23:25.033 28399-28399/? A/DEBUG: ip ae2b7f00 sp bed5d018 lr ae278b45 pc ae278b66 cpsr 600f0030 07-09 16:23:25.033 28399-28399/? A/DEBUG: backtrace: 07-09 16:23:25.033 28399-28399/? A/DEBUG: #00 pc 00162b66 /data/app/com.example.manavdutta1.affdexdemo-2/lib/arm/libopencv_core.so (__emutls_get_address+113) 07-09 16:23:25.033 28399-28399/? A/DEBUG: #01 pc 0015d905 /data/app/com.example.manavdutta1.affdexdemo-2/lib/arm/libopencv_core.so

Here is my build.gradle file:
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
sourceSets.main.jni.srcDirs = []

//task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
//    ndkDir = project.plugins.findPlugin('com.android.application').sdkHandler.getNdkFolder()
//    //on Windows, you need to add ".cmd" after "ndk-build" below
//    commandLine "$ndkDir/ndk-build",
//            'NDK_PROJECT_PATH=build/intermediates/ndk',
//            'NDK_LIBS_OUT=src/main/jniLibs',
//            'APP_BUILD_SCRIPT=src/main/jniLibs/Android.mk',
//            'NDK_APPLICATION_MK=src/main/jniLibs/Application.mk'
//}
//task ndkLibsToJar(type: Zip, dependsOn: 'ndkBuild', description: 'Create a JAR of the native libs') {
//    destinationDir new File(buildDir, 'libs')
//    baseName 'ndk-libs'
//    extension 'jar'
//    from(new File(buildDir, 'libs')) { include '**/*.so' }
//    into 'lib/'
//}
//tasks.withType(JavaCompile) {
//    compileTask -> compileTask.dependsOn ndkBuild
//}
defaultConfig {
    applicationId "com.example.manavdutta1.affdexdemo"
    minSdkVersion 19
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    //exclude 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
    //exclude 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'

    //might need these if you use openCV
    pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
    pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
}
buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}
configurations {
all_.exclude group: 'org.bytedeco', module: 'javacpp-presets'
}
dependencies {
compile fileTree(include: ['_.jar'], dir: 'libs')
compile fileTree(dir: new File(buildDir, 'libs'), include: '*.jar')
testCompile 'junit:junit:4.12'
compile project(path: ':openCVLibrary2411')
compile files('src/main/libs/faceapi.jar')
compile files('src/main/libs/faceppsdk.jar')
//compile files('src/main/libs/artoolkitplus.jar')
//compile files('src/main/libs/ffmpeg.jar')
//compile files('src/main/libs/flandmark.jar')
//compile files('src/main/libs/flycapture.jar')
//compile files('src/main/libs/javacpp.jar')
//compile files('src/main/libs/javacv.jar')
//compile files('src/main/libs/arm/opencv-android-arm.jar')
//compile files('src/main/libs/x86/opencv-android-x86.jar')
//compile files('src/main/libs/libdc1394.jar')
//compile files('src/main/libs/libfreenect.jar')
//compile files('src/main/libs/opencv.jar')
//compile files('src/main/libs/videoinput.jar')
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.affectiva.android:affdexsdk:3.0.1'
compile 'com.microsoft.projectoxford:face:1.0.0'
compile 'com.microsoft.projectoxford:emotion:1.0.0'
compile 'com.android.support:design:23.3.0'
compile 'org.bytedeco:javacv:1.2'
compile 'org.bytedeco.javacpp-presets:opencv:3.1.0-1.2:android-x86'
compile 'org.bytedeco.javacpp-presets:opencv:3.1.0-1.2:android-arm'
//compile group: 'org.bytedeco', name: 'javacv', version: '1.2'

    //compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '2.4.10-0.10', classifier: 'android-arm'
    //compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.5.1-0.10', classifier: 'android-arm'

}

I have no idea how to go about debugging it. It seems the error is occurring in libopencv_core.so, so it might still be an issue with the installation as opposed to the library. Im just not sure though.

@saudet
Copy link
Member

saudet commented Jul 9, 2016

Please try to use JavaCPP 1.2.1 or 1.2.2. Probably a duplicate of #412

@saudet saudet closed this as completed Jul 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants