[Android v7.4.3] PlatformException(channel-error, Unable to establish connection on channel.) when app is idle before video playback
flutter_vlc_player version 7.4.3:
PlatformException(channel-error, Unable to establish connection on channel., null, null)
This occurs specifically when the app is idle for a while and then attempts to play a video. The issue appears similar to Issue #339.
After some investigation, I found that applying a conditional check in the following file resolved the issue temporarily:
File: flutter_vlc_player/flutter_vlc_player/android/src/main/java/software/solid/fluttervlcplayer/FlutterVlcPlayerPlugin.java
Line: 53
if (flutterVlcPlayerFactory == null) {
// Reinitialize the factory or avoid plugin registration errors
}
This conditional check prevents the crash and allows the video player to work correctly again. I'm currently using this as a temporary fix.
Request: I'm looking for a preferred long-term fix or guidance on handling this scenario properly in the plugin code, as this seems related to plugin lifecycle or channel initialization issues when the app goes idle.
Same issue over here, running latest Flutter 3.32.6, but in my case even having the plugin in pubspec breaks shared prefs platform channel
Developers, please help. This problem is not reproduced if the flutter version is 3.27.4, the flutter_vlc_player version is 7.4.2 and if in the FlutterVlcPlayerPlugin.java file you comment out line 53 and line 70. In all other cases, the problem is reproduced. Please join the development and fix the problem, because otherwise people will go to other libraries
Same problem. Really critical issue.
this also happens to me when I try to fork the REPO. But it's not happening when i use the current version which is 7.4.3.
I also tried forking other forks and still the error occurs.