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

App crashes when no WebView installed #342

Closed
nielsvanvelzen opened this issue Apr 16, 2021 · 2 comments · Fixed by #365
Closed

App crashes when no WebView installed #342

nielsvanvelzen opened this issue Apr 16, 2021 · 2 comments · Fixed by #365
Labels
bug Something isn't working

Comments

@nielsvanvelzen
Copy link
Member

Describe the bug

WebView.setWebContentsDebuggingEnabled(true)

^ This check can crash the app if there is no webview. Should probably use the isWebViewSupported() function from WebViewUtils.

To Reproduce

  1. disable webview app
  2. ??
  3. Profit

Expected behavior
No crash

Logs

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.jellyfin.mobile.debug, PID: 13606
    java.lang.RuntimeException: Unable to create application org.jellyfin.mobile.JellyfinApplication: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
        at android.app.ActivityThread.access$1300(ActivityThread.java:237)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
        at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:435)
        at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:252)
        at android.webkit.WebView.getFactory(WebView.java:2576)
        at android.webkit.WebView.setWebContentsDebuggingEnabled(WebView.java:1999)
        at org.jellyfin.mobile.JellyfinApplication.onCreate(JellyfinApplication.kt:27)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
        at android.app.ActivityThread.access$1300(ActivityThread.java:237) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:223) 
        at android.app.ActivityThread.main(ActivityThread.java:7656) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
     Caused by: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed
        at android.webkit.WebViewFactory.getWebViewContextAndSetProvider(WebViewFactory.java:339)
        at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:402)
        at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:252) 
        at android.webkit.WebView.getFactory(WebView.java:2576) 
        at android.webkit.WebView.setWebContentsDebuggingEnabled(WebView.java:1999) 
        at org.jellyfin.mobile.JellyfinApplication.onCreate(JellyfinApplication.kt:27) 
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712) 
        at android.app.ActivityThread.access$1300(ActivityThread.java:237) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:223) 
        at android.app.ActivityThread.main(ActivityThread.java:7656) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947

Screenshots
image

System (please complete the following information):

  • App version: apiclient-1.0 branch
  • Android version: Emulator API 30
  • Device manufacturer and model: Google Emulator
  • Jellyfin server version: 11.0.0
  • The type of video player implementation used: Windows Media Player

Additional context
Probably could've fixed it instead of writing this issue.

@nielsvanvelzen nielsvanvelzen added the bug Something isn't working label Apr 16, 2021
@Maxr1998
Copy link
Member

Additional context
Probably could've fixed it instead of writing this issue.

🤔

Thanks for the report though, makes it easier to track the issue (and link PRs to it).

@nielsvanvelzen
Copy link
Member Author

It's an easy fix but I was to lazy to switch to master to fix it 😂

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

Successfully merging a pull request may close this issue.

2 participants