zoukankan      html  css  js  c++  java
  • android 使用讯飞人脸识别api报错:java.lang.UnsatisfiedLinkError

    1、在做一个人脸识别的项目,使用的是讯飞的api,编辑器为AS2.0,运行时报如下错误:

     FATAL EXCEPTION: main
                      Process: com.admin.smartcam, PID: 13821
                      java.lang.UnsatisfiedLinkError: Native method not found: com.faceplusplus.api.Native.setMinFaceSize:(II)I
                          at com.faceplusplus.api.Native.setMinFaceSize(Native Method)
                          at com.faceplusplus.api.FaceDetecter.setMinFaceSize(FaceDetecter.java:124)
                          at com.admin.smartcam.detectionface.DetectionFace.<init>(DetectionFace.java:21)
                          at com.admin.smartcam.androidcamera.camera.BitmapCallback.PictureCallbackToBitmap.onPictureTaken(PictureCallbackToBitmap.java:26)
                          at android.hardware.Camera$EventHandler.handleMessage(Camera.java:940)
                          at android.os.Handler.dispatchMessage(Handler.java:102)
                          at android.os.Looper.loop(Looper.java:136)
                          at android.app.ActivityThread.main(ActivityThread.java:5111)
                          at java.lang.reflect.Method.invokeNative(Native Method)
                          at java.lang.reflect.Method.invoke(Method.java:515)
                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
                          at dalvik.system.NativeStart.main(Native Method)

    2、分析【可能是因为系统找不到我的.so文件】

    工程目录如下:

    3、解决办法:

    打开build.gradle文件添加如下代码:

        sourceSets {
            main {
                jniLibs.srcDirs = ['libs']
            }
        }

    至此就ok了!

  • 相关阅读:
    mysql启动错误
    maven环境变量配置
    记一次服务器Tomcat优化经历
    自动定时备份删除脚本
    Tomcat网页加载速度过慢的解决方法
    tomcat运行war包报错,找不到context-root文件
    maven下配置pom.xml
    [LeetCode]题解(python):116-Populating Next Right Pointers in Each Node
    [LeetCode]题解(python):115-Distinct Subsequences
    [LeetCode]题解(python):114-Flatten Binary Tree to Linked List
  • 原文地址:https://www.cnblogs.com/ywf520/p/6817267.html
Copyright © 2011-2022 走看看