-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Before creating a new issue, please confirm:
- I have searched for duplicate or closed issues.
- I have read the guide for submitting bug reports.
Which UI component?
Liveness
Gradle script dependencies
ependencies {
def amplifyVersion = "2.29.2"
// ✅ Amplify
implementation "com.amplifyframework.ui:liveness:1.7.1"
implementation "com.amplifyframework:aws-auth-cognito:$amplifyVersion"
implementation "com.amplifyframework:aws-predictions:$amplifyVersion"
implementation "com.amplifyframework:aws-api:$amplifyVersion"
// ✅ UI y Compose
implementation 'com.google.android.material:material:1.13.0'
implementation 'androidx.activity:activity-compose:1.9.3'
implementation 'androidx.compose.ui:ui:1.7.3'
implementation 'androidx.compose.material3:material3:1.3.0'
implementation 'androidx.compose.ui:ui-tooling-preview:1.7.3'
debugImplementation 'androidx.compose.ui:ui-tooling:1.7.3'
// ✅ Otros
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
implementation "com.airbnb.android:lottie:3.6.0"
implementation 'com.android.volley:volley:1.2.1'
}
Environment information
# Put output below this line
------------------------------------------------------------
Gradle 8.7
------------------------------------------------------------
Build time: 2024-03-22 15:52:46 UTC
Revision: 650af14d7653aa949fce5e886e685efc9cf97c10
Kotlin: 1.9.22
Groovy: 3.0.17
Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM: 20.0.2 (Oracle Corporation 20.0.2+9-78)
OS: Windows 10 10.0 amd64
Please include any relevant guides or documentation you're referencing
ValidationException(message=1 validation error detected: Value '0' at 'challenge.faceMovementChallenge.videoEndTimestamp' failed to satisfy constraint: Member must have value greater than or equal to 1640995200000)
Describe the bug
When lifting the life test component, the screen freezes on the capture oval and tells you to move closer, but because it is frozen, it does not take the facial capture and the component returns the error: ValidationException(message=1 validation error detected: Value ‘0’ at ‘challenge.faceMovementChallenge.videoEndTimestamp’ failed to satisfy constraint: Member must have value greater than or equal to 1640995200000)
This only happens to me on One Plus BE2011 devices running Android 10. It works fine on other devices.
version: liveness:1.7.1
Reproduction steps (if applicable)
No response
Code Snippet
// Put your code below this line.
This is the code snippet that raises the liveness component.
private fun showLivenessComponent(sessionID_: String, modoLocal: Boolean) {
showLoader(false)
Logger.Info("Iniciando showLivenessComponent | Session ID: $sessionID_")
val challengeOptions = if (modoChallenge) {
ChallengeOptions(faceMovementAndLight = LivenessChallenge.FaceMovementAndLight)
} else {
ChallengeOptions(faceMovement = LivenessChallenge.FaceMovement(
camera = if (modoCamara) Camera.Back else Camera.Front
))
}
val composeView = ComposeView(this).apply {
setContent {
AppTheme {
FaceLivenessDetector(
sessionId = sessionID_,
region = region,
disableStartView = true,
challengeOptions = challengeOptions,
onComplete = { handleCompletion(sessionID_, modoLocal) },
onError = { handleError(it) }
)
}
}
}
findViewById<FrameLayout>(R.id.content_container).apply {
removeAllViews()
addView(composeView)
}
}
Amplify Configuration:
fun configureAmplify(isProd: Boolean): Boolean {
return try {
// 1. Seleccionar el archivo de configuración adecuado
val configResource = if (isProd) {
R.raw.amplifyconfiguration_prod
} else {
R.raw.amplifyconfiguration_dev
}
// 2. Leer el archivo como JSONObject
val jsonString = resources.openRawResource(configResource)
.bufferedReader()
.use { it.readText() }
val jsonConfig = JSONObject(jsonString)
// 3. Configurar Amplify
Amplify.addPlugin(AWSApiPlugin())
Amplify.addPlugin(AWSCognitoAuthPlugin())
// Método alternativo que funciona con JSONObject
val config = AmplifyConfiguration.fromJson(jsonConfig)
Amplify.configure(config, applicationContext)
Logger.Info("Amplify configurado correctamente")
true
} catch (error: Amplify.AlreadyConfiguredException) {
Logger.Info("Amplify ya estaba configurado, asi que sigue el flujo")
true
} catch (error: AmplifyException) {
Logger.Error("Error configurando Amplify: ${error}")
false
}
}
Log output
// Put your logs below this line
Validatio
nException(message=1 validation error detected: Value '0' at 'challenge.faceMovementChallenge.videoEndTimestamp' failed to satisfy constraint: Member must have value greater than or equal to 1640995200000)}
Configuration File
{
"UserAgent": "aws-amplify-cli/2.0",
"Version": "1.0",
"auth": {
"plugins": {
"awsCognitoAuthPlugin": {
"UserAgent": "aws-amplify-cli/0.1.0",
"Version": "0.1.0",
"IdentityManager": {
"Default": {}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "us-east-1:xxxxx-xxx-xxx-xxxx-xxxxxxxxxxx",
"Region": "us-east-1"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "us-east-1_xxxxxxx",
"AppClientId": "*",
"Region": "us-east-1"
}
},
"Auth": {
"Default": {
"authenticationFlowType": "USER_SRP_AUTH",
"socialProviders": [],
"usernameAttributes": [],
"signupAttributes": [
"EMAIL"
],
"passwordProtectionSettings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
},
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
],
"verificationMechanisms": [
"EMAIL"
]
}
}
}
}
}
}