jackweiwang / Android-FaceDetection-UltraNet-MNN

Android face detection 30+ FPS, pretrained weight 1MB.
MIT License
118 stars 36 forks source link

getting error "couldn't find "libfacedetect.so" #14

Open R-aryan opened 4 years ago

R-aryan commented 4 years ago

Could anyone please give any instructions on how to run this application? I am new to android and i am trying to run this on my phone. But i am not able to do so. I am trying to solve all the errors that i am getting while trying to run this but i am struck at a point and getting the following error.

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.facesdk, PID: 13680 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.facesdk-9GOwYJgoL4MH3zef9FGT6w==/base.apk"],nativeLibraryDirectories=[/data/app/com.facesdk-9GOwYJgoL4MH3zef9FGT6w==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libfacedetect.so"

    at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
    at java.lang.System.loadLibrary(System.java:1657)
    at com.facesdk.FaceSDKNative.<clinit>(FaceSDKNative.java:14)
    at com.facesdk.MainActivity.<init>(MainActivity.java:41)
    at java.lang.Class.newInstance(Native Method)
    at android.app.Instrumentation.newActivity(Instrumentation.java:1174)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)`

My app gradle file

` apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services'

android {

compileSdkVersion 28
defaultConfig {
    applicationId "com.facesdk"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    externalNativeBuild {
        cmake {
            arguments "-DANDROID_STL=c++_shared", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_PLATFORM=android-21",
                      "-DMNN_OPENCL=true",  "-DMNN_OPENGL=true"
            abiFilters  'arm64-v8a', 'armeabi-v7a'
        }
    }
}
buildTypes {
    debug {
        ndk {
            abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
            abiFilters.clear()
        }
    }
    splits {
        abi {
            enable true //enables the ABIs split mechanism
            reset() //reset the list of ABIs to be included to an empty string
            include 'arm64-v8a', 'armeabi-v7a', 'x86'
            universalApk true
        }
    }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

externalNativeBuild {
    cmake {
        path "CMakeLists.txt"
    }
}
ndkVersion '21.0.6113669'

}

dependencies { // implementation fileTree(dir: 'libs', include: ['*.jar']) // 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 'com.android.support:design:28.0.0' // implementation 'com.android.support:cardview-v7:28.0.0'

implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.firebase:firebase-analytics:17.4.3'
//implementation 'com.google.gms:google-services:4.2.0'
//implementation 'com.google.firebase:firebase-core:16.0.7'
testImplementation 'junit:junit:4.12'
implementation 'com.google.firebase:firebase-appindexing:10.2.1'

} //apply plugin: 'com.google.gms.google-services' `

My Project Gradle file ` // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { repositories { jcenter() maven { url 'https://maven.google.com/' name 'Google' } } dependencies { classpath 'com.android.tools.build:gradle:4.0.0' classpath 'com.google.gms:google-services:4.3.3' //classpath 'com.google.gms:google-services:4.2.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { jcenter() maven { url 'https://maven.google.com/' name 'Google' } } }

allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } `

@jackweiwang could you please look into it. Thank You