Skip to content

FaceMovementChallenge not recognized, still requires FaceMovementAndLightChallenge. #262

@sothon19931

Description

@sothon19931

Hi team 👋

I’m trying to use the new FaceMovementChallenge in Amplify UI Android on latest version (release v1.6.0).

Image

Here’s my code:

  1. On challengeOptions use "faceMovement = LivenessChallenge.FaceMovement(camera = Camera.Front)", I found still display flashing lights.

    What it should be :

  • "FaceMovementChallenge" (does not require color reflection) → works with both front and back cameras.
  • "FaceMovementAndLightChallenge" → works only with the front camera, because it requires colors to reflect off the user’s face. **only one option can be selected
MaterialTheme(colorScheme = LivenessColorScheme.default()) {
    FaceLivenessDetector(
        sessionId = sessionId,
        region = "ap-northeast-1",
        credentialsProvider,
        disableStartView = false,
        challengeOptions = ChallengeOptions(
            // faceMovementAndLight = LivenessChallenge.FaceMovementAndLight
               faceMovement = LivenessChallenge.FaceMovement(camera = Camera.Front)
        ),
        onComplete = {
            viewModel.fetchSessionResult(sessionId)
            onChallengeComplete()
        },
        onError = {
            if (it is FaceLivenessDetectionException.UserCancelledException) {
                onBack()
            } else {
                viewModel.reportErrorResult(it)
                onChallengeComplete()
            }
        }
    )
}
  1. From 1), since using FaceMovementChallenge still shows the flashing lights, I tried removing FaceMovementAndLightChallenge("2.0.0") and using only FaceMovementChallenge("1.0.0"), but then I get this error:

PredictionsException{message=An error occurred during the face liveness flow.,
cause=ValidationException(message=Missing challenge versions or no supported challenge version found.)}

val faceLivenessSessionInformation = FaceLivenessSessionInformation(
    videoWidth = TARGET_WIDTH.toFloat(),
    videoHeight = TARGET_HEIGHT.toFloat(),
    challengeVersions = listOf(
        // Challenge.FaceMovementAndLightChallenge("2.0.0"), // removed
        Challenge.FaceMovementChallenge("1.0.0")
    ),
    region = region,
    preCheckViewEnabled = !disableStartView,
    attemptCount = attemptCounter.getCount()
)

What I’ve observed

  • If I include FaceMovementAndLightChallenge("2.0.0") or use only FaceMovementAndLightChallenge, it works fine — and correctly still triggers the flashing lights challenge.
  • If I try FaceMovementChallenge("1.0.0") by itself, the session fails with the ValidationException above.

My questions are:

  1. Why does this error occur when I only provide FaceMovementChallenge without FaceMovementAndLightChallenge?
  2. Did I configure something wrong, or is this the reason why "FaceMovementChallenge" still shows the flashing lights?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions