flutter_vlc_player icon indicating copy to clipboard operation
flutter_vlc_player copied to clipboard

[Android v7.4.3] PlatformException(channel-error, Unable to establish connection on channel.) when app is idle before video playback

Open Dinith-k opened this issue 7 months ago • 4 comments

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.

Dinith-k avatar May 07 '25 10:05 Dinith-k

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

mikeb2k avatar Jul 16 '25 16:07 mikeb2k

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

babayanta1994 avatar Jul 18 '25 11:07 babayanta1994

Same problem. Really critical issue.

bailyzheng avatar Jul 31 '25 15:07 bailyzheng

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.

jorelkimcruz avatar Sep 08 '25 07:09 jorelkimcruz