'Json file links working in local, but not in production
I've a JSON file in assets and my radio app works fine in local, streaming from the links given, however in prod, the names of the list show but whenever I click on play, it's unable to play the links, I am not able to figure out why
https://play.google.com/store/apps/details?id=noad.radio
When I install the same app through debug mode directly I works fine, the links play music, when uploaded to playstore it doesn't
JSON is as such
[{ "name": "90s Super Hits live", "url": "http://103.16.47.70:7444/;stream.mp3", "language": "hindi" }, { "name": "90s Super Hits live2", "url": "http://103.16.47.70:7222/;stream.mp3", "language": "hindi" }, { "name": "90s SuperHits", "url": "http://103.16.47.70:7444/;stream?type=http&nocache=10", "language": "hindi" }]
And I've android:usesCleartextTraffic="true" in main AndroidManifest.XML
Solution 1:[1]
Okay this as a permission issue, as I didn't add
<uses-permission android:name="android.permission.INTERNET" />
And my app needed internet permission to play the streams, it worked locally, and in prod it didn't
Post adding this, it's working as required
To check the behavior of prod, use
Flutter run --release
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kavi Harjani |