当我在运行EMUI 10.0的设备上使用3D面部认证功能时,报告以下错误:错误代码= 1
// Cancellation Signal
CancellationSignal cancellationSignal = new CancellationSignal();
FaceManager faceManager = new FaceManager(this);
// Checks whether 3D facial authentication can be used.
int errorCode = faceManager.canAuth();
if (errorCode != 0) {
resultTextView.setText("");
showResult("Can not authenticate. errorCode=" + errorCode);
return;
}
操作设备:P40 Pro 或荣耀 30 Pro
3D面部认证功能取决于设备硬件。目前,它只能在Mate 20 Pro和Mate 30 Pro设备上使用。
嗨,虽然上面的答案是正确的,但我强烈建议您浏览下面的错误列表,并亲自查看此代码提供的确切原因。
https://developer.huawei.com/consumer/en/doc/HMSCore-References-V5/facemanager_x-0000001050418949-V5
https://developer.huawei.com/consumer/en/doc/HMSCore-References-V5/bioauthn_facemanager-0000001050180181-V5
错误的确切解释是:
公共静态最终 int FACE_ERROR_HW_UNAVAILABLE
调用 Auth 方法后,BioAuthnCallback的onAuthError方法中errorCode参数的返回值;canAuth API 的返回值:1
没有可用的身份验证硬件。请稍后再试。