beeware / beeware/toga

Unable to load spotify webplayer on android phone

Open
#2,280 6 comments 0 reactions 0 assignees View on GitHub
android bug
Dominant language
Python
Stars
5.4k
Forks
827
Avg merge
9h 45m
Merged PRs (30d)
58

Description

### Describe the bug

I am unable to load the spotify webplayer (while the normal login page loads). The website remains stuck at the moving 3 dots.

### Steps to reproduce

I used the example from the toga website:
https://toga.readthedocs.io/en/stable/reference/api/widgets/webview.html
and example here :
https://gist.github.com/simonw/b43343d437f05f5b0c73d814fcd9e5ba
In both of the cases, the spotify webplayer remains stuck.

### Expected behavior

Loading of the spotify website with the webplayer.

### Screenshots

_No response_

### Environment

- Operating System: android (emulator) and physical device (OnePlus 10)
- Python version: 3.8.18
- Software versions:
- Briefcase: '0.3.16'
- Toga:'0.4.0'

### Logs

W/m.example.test1: Long monitor contention with owner ThreadPoolForeg (21790) at org.chromium.net.AndroidCertVerifyResult OB0.h(byte[][], java.lang.String, java.lang.String)(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:242) waiters=2 in org.chromium.net.AndroidCertVerifyResult OB0.h(byte[][], java.lang.String, java.lang.String) for 222ms

I/chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read properties of null (reading 'getItem')", source: https://open.spotifycdn.com/cdn/build/web-player/vendor~web-player.f22720bd.js (1)

W/native.stderr: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read properties of null (reading 'getItem')", source: https://open.spotifycdn.com/cdn/build/web-player/vendor~web-player.f22720bd.js (1)

I/chromium: [INFO:CONSOLE(0)] "The resource https://open.spotifycdn.com/cdn/generated-locales/web-player/en.c4239d5f.json was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://open.spotify.com/ (0)

W/native.stderr: [INFO:CONSOLE(0)] "The resource https://open.spotifycdn.com/cdn/generated-locales/web-player/en.c4239d5f.json was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://open.spotify.com/ (0)

I/chromium: [INFO:CONSOLE(0)] "The resource https://open.spotifycdn.com/cdn/fonts/spoticon_regular_2.d728648c.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://open.spotify.com/ (0)

W/native.stderr: [INFO:CONSOLE(0)] "The resource https://open.spotifycdn.com/cdn/fonts/spoticon_regular_2.d728648c.woff2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://open.spotify.com/ (0)

### Additional context

The application works in the dev mode. On both emulator and physical device, the login page loads but gets stuck for the webplayer.
I already updated the cleartextTrafficPermitted="true" in network_security_config.xml as well as updating build parameters in gradle.build (proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', adding dependencies of andriod webkit) as well as tried looking at javascript.

Contributor guide

Open the contributing guide

Research direction

Start with the Android WebView path behind the Toga webview example and reproduce Spotify on the emulator or physical device, then inspect the reported getItem null console error. Compare the dev and packaged builds, including network_security_config.xml, gradle.build, and Android WebKit settings; done means the Spotify webplayer loads in both packaged environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, python
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.