hCaptcha / hcaptcha-android-sdk

Android SDK for hCaptcha
https://www.hcaptcha.com
MIT License
72 stars 35 forks source link

Getting "NETWORK_ERROR" in device with no Google Play Services #154

Closed jefftrigueiro closed 5 months ago

jefftrigueiro commented 5 months ago

Tried to use hcaptcha with a POS with no Google Play Services an I am getting NETWORK_ERROR. In other devices with Google Play Services it's working fine.

In the logcat I saw this:

DialogFragment.onCreateView inflated WebViewHelper.setupWebView webres/webapp.xml is not exist WebViewHelper.loadData. Hardware acceleration enabled: false DialogFragment.onStart Skipped 255 frames! The application may be doing too much work on its main thread. Unsupported mime video/divx Unsupported mime video/divx4 Davey! duration=4983ms; Flags=1, IntendedVsync=182945349495, Vsync=187195349325, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=187209691333, AnimationStart=187209844666, PerformTraversalsStart=187216794510, DrawStart=187775107374, SyncQueued=187869617166, SyncStart=187878689822, IssueDrawCommandsStart=187920883520, SwapBuffers=187935537270, FrameCompleted=187937799770, DequeueBufferDuration=263000, QueueBufferDuration=1072000, could not parse long range '689-670' could not parse long range '689-670' [webview] onProgressChanged 10% [webview] onLoadResource data:text/html;charset=utf-8;base64,... Skipped 72 frames! The application may be doing too much work on its main thread. [webview] onProgressChanged 70% [webview] onPageStarted about:blank... Davey! duration=1262ms; Flags=0, IntendedVsync=187222193619, Vsync=188422193571, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=188432791801, AnimationStart=188433048884, PerformTraversalsStart=188433610759, DrawStart=188433913520, SyncQueued=188450762530, SyncStart=188465510187, IssueDrawCommandsStart=188494809509, SwapBuffers=188497427582, FrameCompleted=188499215655, DequeueBufferDuration=464000, QueueBufferDuration=796000, Failed to init handler: Attempt to invoke virtual method 'java.lang.reflect.Constructor java.lang.Class.getDeclaredConstructor(java.lang.Class[])' on a null object reference url is not in white list shouldIR Intercept 1:https://js.hcaptcha.com/1/api.js?render=explicit&onload=onHcaptchaLoaded&recaptchacompat=off&hl=pt&host=9902c51c-3d22-4636-9830-8f8e894882e2.android-sdk.hcaptcha.com&sentry=true JSInterface.onError 7 [webview] onProgressChanged 80% HCaptcha.onFailure [webview] onConsoleMessage Uncaught ReferenceError: hcaptcha is not defined Skipped 37 frames! The application may be doing too much work on its main thread. Davey! duration=937ms; Flags=1, IntendedVsync=190530461035, Vsync=191147127677, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=191164032633, AnimationStart=191164117217, PerformTraversalsStart=191167858363, DrawStart=191420339300, SyncQueued=191460737894, SyncStart=191470608779, IssueDrawCommandsStart=191470791019, SwapBuffers=191476301019, FrameCompleted=191478319196, DequeueBufferDuration=204000, QueueBufferDuration=777000, DialogFragment.onDestroy WebViewHelper.destroy Background young concurrent copying GC freed 114783(5925KB) AllocSpace objects, 11(416KB) LOS objects, 38% free, 10233KB/16MB, paused 5.162ms total 249.890ms Couldn't find 'tcm' socket after 120times. quit trying

I think that the main problem is: url is not in white list shouldIR Intercept 1:https://js.hcaptcha.com/1/api.js?render=explicit&onload=onHcaptchaLoaded&recaptchacompat=off&hl=pt&host=9902c51c-3d22-4636-9830-8f8e894882e2.android-sdk.hcaptcha.com&sentry=true JSInterface.onError 7

jefftrigueiro commented 5 months ago

The problem is with the POS that I used. When I created an emulator with no google play services, it worked.