warren-bank / Android-WebCast

Android app to extract video (file/stream) URLs from websites and watch them elsewhere (internal/external video player, Google Chromecast, ExoAirPlayer).
GNU General Public License v2.0
94 stars 17 forks source link

App will force close when trying to load complex websites in an outdated WebView. #2

Closed sagorahmed closed 5 years ago

sagorahmed commented 5 years ago

Expected behavior

The users should be able to visit web pages without getting any trouble.

Actual behavior

When I visited and tried to open a post, then the app crashed. https://steemit.com was the website.

How to reproduce

  1. Open the app
  2. Go to https://steemit.com
  3. Try to open a post by clicking on it. A few seconds later notice the bug.

LogCat

All the logs that I produced on my phone.

05-21 16:13:49.996  2697  3586 I WindowState: WIN DEATH: Window{787efe1 u0 d0 p17267 com.github.warren_bank.webcast/com.github.warren_bank.webcast.webview.BrowserActivity}

05-21 16:13:49.996  2697  2712 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=95, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ], android.os.BinderProxy@dfcb6c2)

05-21 16:13:49.996  2697  2711 I ActivityManager: Process com.github.warren_bank.webcast (pid 17267)(adj 1) has died(93,304)

05-21 16:13:49.996  2697  3093 D ConnectivityService: releasing NetworkRequest NetworkRequest [ id=95, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]

05-21 16:13:49.996  2697  2711 D ActivityManager: cleanUpApplicationRecord -- 17267

05-21 16:13:49.996  2697  3093 D ConnectivityService: sending notification RELEASED for NetworkRequest [ id=95, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]

05-21 16:13:49.996  2697  3590 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=96, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ], android.os.BinderProxy@551cd3)

05-21 16:13:50.006  2697  2711 D ActivityManager: removeProcessNameLocked mProcessNames.remove pid=17267 ,hash=25155352 ,name=com.github.warren_bank.webcast

05-21 16:13:50.006  2697  2711 D ActivityManager: isAutoRunBlockedApp:: com.github.warren_bank.webcast, Auto Run ON
warren-bank commented 5 years ago

hmm..

Just trying it out on a very low-performance phone that's sitting next to me at the moment.. I can't reproduce this. The site and its posts load fine.

I'll try googling some of the terms in your logcat.. to see if they can give me some clue as to what happened. But ultimately, I don't think that there's really anything I could do if a website was to crash your WebView. I mean.. the WebView is entirely responsible for browsing the web, and it isn't part of this app.. it's a common component that's already on your phone.. and is simply used by this app (as well as by many others).

warren-bank commented 5 years ago

I'd be curious to know if the WebView in this app.. which comes from this article.. crashes as well.. since it is super bare-bones.. having no functionality beyond a WebView and bookmarks.

webview-debug.apk.zip

sagorahmed commented 5 years ago

Hi @warren-bank Don't know why occurring it on that specific site. But this crash confused me as well after I captured using ADB. There are no error logs and no FATAL EXCEPTION about this app in that logcat file. After searching many ways, i found those logs but I don't know those logs are responsible for crash or not. I think you should try this issue on an android emulator. I have also replicated this issue in your provided file

bug

warren-bank commented 5 years ago

hmm..

well, since you're seeing similar crash behavior in that bare-bones app.. then it definitely traces back to the WebView component on your system.

just out of curiousity.. are you using a custom ROM? ..custom WebView component (ex: Bromite SystemWebView)? ..is there anything about your system that would make it potentially unstable?

sagorahmed commented 5 years ago

No, I haven't installed custom ROM on my phone.

warren-bank commented 5 years ago

Is your Android System WebView fairly recent?

..I mean, it looks like the javascript on the page is crashing the component. Maybe it's just really old and needs an update?

sagorahmed commented 5 years ago

Oh god! my phone's Android system Webview was updated a long time ago. Now it is not occurring. Thanks for encountering the main issue! :)

warren-bank commented 5 years ago

I'm glad for you that's all it was.. easy fixes are always the best fixes. :)

sagorahmed commented 5 years ago

Is it possible to inform the users about the outdated Android system Webview from this app??

warren-bank commented 5 years ago

The README already has a section about that topic.

Personally, I feel that serves as enough of a warning. I don't think an app should nag the user to upgrade external dependencies.. I'd find that very annoying.

Plus, there's the whole issue that the WebView ecosystem is inconsistent. Android 4.x is stuck with whatever was baked into their OS. Android 5-7 can upgrade. Android 7+ defaults to using Chrome (if it's installed).. and falling back to the upgradable system WebView if it isn't.. plus they can install alternate WebViews and choose which one to use as default under developer settings. It's a mess.. and ultimately it boils down to each Android user/owner being responsible for maintaining/upgrading their own system in whatever way they like best.

sagorahmed commented 5 years ago

Hmm, I got it. It's been a pleasure to talk with you. I learned something new from you. Thanks!