We have integrated reCaptcha enterprise in our android app.
Gradle dependency we are using is 'com.google.android.recaptcha:recaptcha:18.0.1
'.
There are reports from our users that they are not able to login into the app.
We checked this and found out that reCaptcha library is failing to generate token with timeout exception.
We initialize the recaptcha SDK using:-
recaptchaTasksClient.executeTask(getCaptchaAction(event))
.addOnSuccessListener(token -> {
if (context != null) {
((RecaptchaTokenListener) context).onSuccess(event, token);
}
})
.addOnFailureListener(e -> {
if (context != null) {
((RecaptchaTokenListener) context).onFailure();
}
});
public interface RecaptchaTokenListener {
void onSuccess(CaptchaEvent event, String token);
void onFailure();
}
Please suggest what steps can be taken to resolve the issue completely.
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:184)
at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:154)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:344)
at android.app.ActivityThread.main(ActivityThread.java:8249)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)