GoogleCloudPlatform / recaptcha-enterprise-mobile-sdk

Apache License 2.0
31 stars 6 forks source link

[Bug]: PlatformException(FL_INIT_FAILED, com.google.android.recaptcha.RecaptchaException: Network Error, null, null)) #72

Closed hamishnorton closed 1 year ago

hamishnorton commented 1 year ago

Are you seeing the problem on Android or iOS?

Android

Contact Details

hamish.norton@theta.co.nz

Describe the bug

PlatformException (PlatformException(FL_INIT_FAILED, com.google.android.recaptcha.RecaptchaException: Network Error, null, null))

Site Key

No response

Select the method used to integrate with reCAPTCHA Mobile.

GMaven (Android)

SDK Version

18.3.0

To Reproduce

  1. Run app with await RecaptchaEnterprise.initClient(siteKeyAndroid);

Expected behavior

RecaptchaEnterprise to initialize without error.

Development IDE

VSCode 1.82.2

To Reproduce

Relevant log output

W/ovt.xxxx.xx.xx(15049): Entry not found
I/WebViewFactory(15049): Loading com.google.android.webview version 116.0.5845.172 (code 584517233)
I/cr_WVCFactoryProvider(15049): Loaded version=116.0.5845.172 minSdkVersion=29 isBundle=true multiprocess=true packageId=2
I/cr_LibraryLoader(15049): Successfully loaded native library
I/cr_CachingUmaRecorder(15049): Flushed 7 samples from 7 histograms, 0 samples were dropped.
W/chromium(15049): [WARNING:dns_config_service_android.cc(115)] Failed to read DnsConfig.
D/CompatibilityChangeReporter(15049): Compat change id reported: 171228096; UID 10877; state: ENABLED
D/ConnectivityManager(15049): StackLog: [android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:3925)] [android.net.ConnectivityManager.registerDefaultNetworkCallbackForUid(ConnectivityManager.java:4489)] [android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4456)] [WV.Q10.e(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:38)] [WV.Q10.a(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:1)] [org.chromium.android_webview.AwContentsLifecycleNotifier.onFirstWebViewCreated(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:24)] [J.N.MFiR_zHY(Native Method)] [org.chromium.android_webview.AwContents.<init>(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:426)] [com.android.webview.chromium.k.run(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:111)] [WV.sC0.b(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:20)] [WV.rC0.run(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:3)] [org.chromium.base.task.PostTask.d(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:11)] [WV.sC0.a(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:23)] [com.android.webview.chromium.WebViewChromiumFactoryProvider.a(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:3)] [com.android.webview.chromium.WebViewChromium.init(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:332)] [android.webkit.WebView.<init>(WebView.java:445)] [android.webkit.WebView.<init>(WebView.java:365)] [android.webkit.WebView.<init>(WebView.java:347)] [android.webkit.WebView.<init>(WebView.java:334)] [android.webkit.WebView.<init>(WebView.java:324)] [com.google.android.recaptcha.internal.zzv.zza(com.google.android.recaptcha:recaptcha@@18.3.0:12)] [com.google.android.recaptcha.internal.zzv.zzb(com.google.android.recaptcha:recaptcha@@18.3.0:2)] [com.google.android.recaptcha.Recaptcha$getClient$2$1.invokeSuspend(com.google.android.recaptcha:recaptcha@@18.3.0:3)] [kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)] [kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)]
D/ConnectivityManager(15049): StackLog: [android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:3925)] [android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:3967)] [android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:4349)] [WV.Q10.e(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:118)] [WV.Q10.a(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:1)] [org.chromium.android_webview.AwContentsLifecycleNotifier.onFirstWebViewCreated(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:24)] [J.N.MFiR_zHY(Native Method)] [org.chromium.android_webview.AwContents.<init>(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:426)] [com.android.webview.chromium.k.run(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:111)] [WV.sC0.b(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:20)] [WV.rC0.run(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:3)] [org.chromium.base.task.PostTask.d(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:11)] [WV.sC0.a(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:23)] [com.android.webview.chromium.WebViewChromiumFactoryProvider.a(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:3)] [com.android.webview.chromium.WebViewChromium.init(chromium-TrichromeWebViewGoogle6432.aab-stable-584517233:332)] [android.webkit.WebView.<init>(WebView.java:445)] [android.webkit.WebView.<init>(WebView.java:365)] [android.webkit.WebView.<init>(WebView.java:347)] [android.webkit.WebView.<init>(WebView.java:334)] [android.webkit.WebView.<init>(WebView.java:324)] [com.google.android.recaptcha.internal.zzv.zza(com.google.android.recaptcha:recaptcha@@18.3.0:12)] [com.google.android.recaptcha.internal.zzv.zzb(com.google.android.recaptcha:recaptcha@@18.3.0:2)] [com.google.android.recaptcha.Recaptcha$getClient$2$1.invokeSuspend(com.google.android.recaptcha:recaptcha@@18.3.0:3)] [kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)] [kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)]
W/cr_media(15049): BLUETOOTH_CONNECT permission is missing.
W/cr_media(15049): registerBluetoothIntentsIfNeeded: Requires BLUETOOTH permission
W/AudioCapabilities(15049): Unsupported mime audio/x-ape
W/AudioCapabilities(15049): Unsupported mime audio/x-ima
W/AudioCapabilities(15049): Unsupported mime audio/mpeg-L1
W/AudioCapabilities(15049): Unsupported mime audio/mpeg-L2
W/VideoCapabilities(15049): Unsupported mime video/mp43
W/VideoCapabilities(15049): Unsupported mime video/wvc1
W/VideoCapabilities(15049): Unsupported mime video/x-ms-wmv
W/AudioCapabilities(15049): Unsupported mime audio/x-ms-wma
W/VideoCapabilities(15049): Unsupported mime video/x-ms-wmv7
W/VideoCapabilities(15049): Unsupported mime video/x-ms-wmv8

Relevant log output

image

mcorner commented 1 year ago

@hamishnorton Thanks for the report. This is clearly a flutter integration so I may move your issue, but let's try and narrow down the problem.

Does this happen on every getClient on this device? This is due to the SDK not being able to reach one of our hosts, either recaptcha.net or gstatic.com. Can you verify that those hosts are reachable from the device and you can reach other hosts?

Do you have any kind of proxy, network blocking, firewall etc set up for this device? Can you try a different network?

Thanks, Mark

hamishnorton commented 1 year ago

Hi @mcorner , After checking connectivity to those hosts with the device I discovered the problem. It was to do with a local network issue that occurred a day or too back, and the device not noticing. I've also tested on an Android 11 device and it worked fine. Feel free to close the issue.

Could be nice to have some feedback out of the .initClient() method to indicate the problem though to limit the possibility of people without connectivity to the hosts logging an issue.