Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android ServiceWorkerControllerCompat.setServiceWorkerClient(null) makes Webivew Plugin Crashes #1151

Closed
4 tasks done
ycv005 opened this issue Apr 24, 2022 · 6 comments
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@ycv005
Copy link
Contributor

ycv005 commented Apr 24, 2022

Environment

Technology Version
Flutter version 2.10.5
Plugin version flutter_inappwebview: 5.4.1+1
Android version 12
iOS version NA
Xcode version NA

Device information:

Realme GT Master Edition

Description

After update the Webview Plugin getting below error (The Error Log is very long and is not readable. I have shared the readable part)

E/cr_AwBgThreadClient(10843): Client raised exception in shouldInterceptRequest. Re-throwing on UI thread.
E/cr_AwBgThreadClient(10843): The following exception was raised by shouldInterceptRequest:
D/AndroidRuntime(10843): Shutting down VM
E/AndroidRuntime(10843): FATAL EXCEPTION: main
E/AndroidRuntime(10843): Process: com.example.tbo, PID: 10843
E/AndroidRuntime(10843): java.lang.NullPointerException: Attempt to invoke virtual method 'android.webkit.WebResourceResponse androidx.webkit.ServiceWorkerClientCompat.shouldInterceptRequest(android.webkit.WebResourceRequest)' on a null object reference
E/AndroidRuntime(10843): 	at androidx.webkit.internal.FrameworkServiceWorkerClient.shouldInterceptRequest(FrameworkServiceWorkerClient.java:45)
E/AndroidRuntime(10843): 	at Sf0.a(chromium-TrichromeWebViewGoogle6432.aab-stable-489612734:32)
E/AndroidRuntime(10843): 	at Sa.a(chromium-TrichromeWebViewGoogle6432.aab-stable-489612734:122)
E/AndroidRuntime(10843): 	at org.chromium.android_webview.AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(chromium-TrichromeWebViewGoogle6432.aab-stable-489612734:31)
2
F/crashpad(15624): -----BEGIN CRASHPAD MINIDUMP-----
F/crashpad(15624): )iyJ"&cB3vRwF=78_8Q_"WjDe_7,&~]&iJ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C[!YK?7ge>Q;V7W~tEJYd_;hvvcwRkAEL)*Grya1e&wLAuL`bxa~LSa%T:yEu-!&3owu>zsQnBLhL/cw,eZFscC3-lB;oBG_3%HX$].xo^<3_O5X}yu$UBJDgF/etZ(E?~Qq$K}r'\^EA#S{cN\UNES6aC0Es2}nW]hEKr]sQses]=fU6/(z2lIo6{OTBi(u\Pivb!8|OK>y,J<EKH2JGH*dsJA->Au./=/zHQvjz#4W4{VbgfvA\,M@.%4IUBopzG[EsO)TYh54lpI?@L[c2D(0l^F)ezn[2B&Doia9s@W]ZttR]APc.pohhRxgvPp2r_um>F)SF6P6Svp175<W)8lGA}p~duO]>d.<qr*}K}YoWtm@+("'K.ZwnT`'RNl#,s`GfxGx+6PZR4q6<EK7S}gBs&1&EO@^V;gLL2,vdh81u`TLK<7[w&V4qV,}KLopW@m,A~''lyYaoQL-R81\ME9in`r"oUBJYz&g@:AlgtV

Expected behavior:

Current behavior:

Steps to reproduce

  1. This
  2. Than that
  3. Then

Images

Stacktrace/Logcat

@ycv005 ycv005 added the bug Something isn't working label Apr 24, 2022
@github-actions
Copy link

👋 @ycv005

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@pichillilorenzo
Copy link
Owner

Are you using the Service Worker Controller API?

@ycv005
Copy link
Contributor Author

ycv005 commented Apr 25, 2022

@pichillilorenzo I am not aware of that, can you tell me where to check. For now, I can show you piece of code, executed my side.
I think introducing shareState might has cause the issue, beause before that, all was working fine.

 _browser.open(
        url: Uri.parse(redirectUrl),
        options: ChromeSafariBrowserClassOptions(
          android: AndroidChromeCustomTabsOptions(
            toolbarBackgroundColor: Color(int.parse(color)),
            // shareState: CustomTabsShareState.SHARE_STATE_OFF,
            addDefaultShareMenuItem: false,
            enableUrlBarHiding: true,
          ),
        ),
      );

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Apr 25, 2022

I mean if you are using the AndroidServiceWorkerController class somewhere inside of your code, such as my code example here:

AndroidServiceWorkerController serviceWorkerController =

However, it shouldn't be related to the ChromeSafariBrowser class. So, it is something else.

@pichillilorenzo
Copy link
Owner

Ok, I found out what is the problem. I will fix it soon!

@pichillilorenzo pichillilorenzo changed the title Latest Webivew Plugin Crashes Android ServiceWorkerControllerCompat.setServiceWorkerClient(null) makes Webivew Plugin Crashes Apr 25, 2022
@pichillilorenzo
Copy link
Owner

Released new version 5.4.1+2 with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants