Android使用百度人脸识别报错com.baidu.idl.facesdk.BDFaceUtils

前段使用Android百度人脸识别,运行时出现:

Error: Program type already present: com.baidu.idl.facesdk.BDFaceUtils

原因是jar包冲突。

经网上搜索和测试,解决方法如下:

\faceplatform\build.gradle

dependencies{

    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile files('libs/facesdk.jar')

    compile files('libs/ast.jar')

    compile files('libs/baidu_license.jar')

}

改成

dependencies {

    api files('libs/facesdk.jar')

    api files('libs/baidu_license.jar')

    api files('libs/ast.jar')

}

你可能感兴趣的:(Android使用百度人脸识别报错com.baidu.idl.facesdk.BDFaceUtils)