android[version 7.1.5]PlatformException(channel-error, Unable to establish connection on channel., null, null)
version
flutter_vlc_player: ^7.1.5
my code
class MyHomePage extends StatefulWidget {
MyHomePage({Key? key}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
late VlcPlayerController _videoPlayerController;
@override
void initState() {
super.initState();
_videoPlayerController = VlcPlayerController.network(
VlcController.instance.url.value,
hwAcc: HwAcc.full,
autoPlay: true,
options: VlcPlayerOptions(),
);
}
@override
void dispose() async {
super.dispose();
await _videoPlayerController.stopRendererScanning();
await _videoPlayerController.dispose();
}
@override
Widget build(BuildContext context) {
return VlcPlayer(
controller: _videoPlayerController,
aspectRatio: 16 / 9,
placeholder: const Center(child: CircularProgressIndicator()),
);
}
}
I/flutter (10775): uncaught error : PlatformException(channel-error, Unable to establish connection on channel., null, null) #0 VlcPlayerApi.initialize (package:flutter_vlc_player_platform_interface/src/messages/messages.dart:576)
I/flutter (10775): <asynchronous suspension>
I/flutter (10775): #1 MethodChannelVlcPlayer.init (package:flutter_vlc_player_platform_interface/src/method_channel/method_channel_vlc_player.dart:27)
I/flutter (10775): <asynchronous suspension>
I/flutter (10775):
I/flutter (10775): uncaught error : PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: flutter_video_plugin/getVideoView
I/flutter (10775): at m3.m$a.d(Unknown Source:275)
I/flutter (10775): at i3.j$a.b(Unknown Source:232)
I/flutter (10775): at i3.j$a.D(Unknown Source:175)
I/flutter (10775): at j3.j$a.a(Unknown Source:17)
I/flutter (10775): at w2.c.j(Unknown Source:18)
I/flutter (10775): at w2.c.k(Unknown Source:20)
I/flutter (10775): at w2.c.g(Unknown Source:0)
I/flutter (10775): at w2.b.run(Unknown Source:12)
I/flutter (10775): at android.os.Handler.handleCallback(Handler.java:938)
I/flutter (10775): at android.os.Handler.dispatchMessage(Handler.java:99)
I/flutter (10775): at android.os.Looper.loopOnce(Looper.java:201)
I/flutter (10775): at android.os.Looper.loop(Looper.java:288)
I/flutter (10775): at android.app.ActivityThread.main(ActivityThread.java:7839)
I/flutter (10775): at java.lang.reflect.Method.invoke(Native Method)
I/flutter (10775): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
I/flutter (10775): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
I/flutter (10775): , null, null) #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607)
I/flutter (10775): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167)
I/flutter (10775): <asynchronous suspension>
I/flutter (10775): #2 TextureAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1134)
I/flutter (10775): <asynchronous suspension>
I/flutter (10775): #3 AndroidViewController.create (package:flutter/src/services/platform_views.dart:762)
I/flutter (10775): <asynchronous suspension>
I/flutter (10775): #4 TextureAndroidViewController.setSize (package:flutter/src/services/platform_views.dart:1062)
I/flutter (10775): <asynchronous suspension>
I/flutter (10775): #5 RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:179)
I/flutter (10775): <asynchronous suspension>
I/flutter (10775):
Hi friend, I have the same problem, did you manage to solve it?
Hello friend, yes, I solved it. It seems that there is a logic error in native Android
I tried to find the solved source code on the local machine, but I'm sorry. It seems that I deleted it one day ago
Thank you very much, it is already a way for me to try to solve this problem.
Can you remember, in which part of the native android?
Can you remember, in which part of the native android?
You can try to delete this line, which should solve the problem
https://github.com/solid-software/flutter_vlc_player/blob/07532cb8835a32393f421761447a6649c561d99e/flutter_vlc_player/android/src/main/java/software/solid/fluttervlcplayer/FlutterVlcPlayerPlugin.java#L53
I still have the same error, is there anything else to modify, but thanks for the help.
I still have the same error, is there anything else to modify, but thanks for the help.
Hi, i know its a little late but did you solve the problem, i am developing for ios and android and both are not working.