learningequality / kolibri-installer-android

Android wrapper for Kolibri.
MIT License
26 stars 22 forks source link

Continual spewing of "WebViewLoader: Could not ping localhost:5000" in Android app long after it has loaded and is being used. #90

Closed marcellamaki closed 2 years ago

marcellamaki commented 2 years ago

@jamalex notes from bug bash: per logcat — it seems it continues to try to check the server even when not available — and actually, it's not even running on port 5000, it's on 8080 — seems like it's a pew thing

https://www.notion.so/learningequality/BUG-ish-Continual-spewing-of-WebViewLoader-Could-not-ping-localhost-5000-in-Android-app-long-aft-282e4478d4c94f699edb773ea582a29a

kollivier commented 2 years ago

👋

I'm pretty sure this is a python-for-android thing, their webview backend by default assumes there's a Flask server running on port 5000 and keeps pinging it until it finds it so it can know when to load the UI, which in this case it never will. Here's where the message is probably coming from:

https://github.com/kivy/python-for-android/blob/a9eee16b32d1991f04d4d6316c6320ad0dde4524/pythonforandroid/bootstraps/webview/build/templates/WebViewLoader.tmpl.java#L35

It does take a port argument, so it may be possible to update pew to pass down a port argument to the p4a command, so that it's checking the port Kolibri is running on. As the Kolibri app does its own checking, this may be redundant, but it is probably a much less painful fix than trying to patch this class template file. Would be happy to accept any PRs to pew proper that lets you specify the server port in project_info.json, or, no promises, but maybe I could look at this myself over the holidays, as this would be nice to have for my own projects as well.

rtibbles commented 2 years ago

Hi @kollivier - we're planning to write our own custom p4a bootstrap in order to make some further changes to the loading experience, so no need to prioritize this on our account!