sony / flutter-elinux-plugins

Flutter plugins for embedded Linux (eLinux)
BSD 3-Clause "New" or "Revised" License
43 stars 23 forks source link

[Video Player] PlatformException occurs in video_player example #78

Closed makotosato-at closed 10 months ago

makotosato-at commented 10 months ago

Hello.

I'm using Debian(bullseye) on my PC(x86_64) and flutter-elinux 3.13.0 When I run the video_player example, I get the following error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      AndroidVideoPlayerApi.initialize (package:video_player_android/src/messages.g.dart:272)
<asynchronous suspension>

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      AndroidVideoPlayerApi.setMixWithOthers (package:video_player_android/src/messages.g.dart:522)
<asynchronous suspension>
#1      VideoPlayerController.initialize (package:video_player/video_player.dart:361)
<asynchronous suspension>

Here are the steps:

$ git clone https://github.com/sony/flutter-elinux-plugins.git
$ cd flutter-elinux-plugins/packages/video_player/example
$ flutter-elinux pub get
$ flutter-elinux run -d elinux-x11 --release

It does not occur in debug mode(--debug).

HidenoriMatsubayashi commented 10 months ago

First of all, didn't you encounter build errors with flutter-elinux 3.13.0? Because event_channel API was wrong in 3.13.0 (See https://github.com/sony/flutter-embedded-linux/commit/23589c382dbddf8542da4c72aff4ff42a96dca44).

makotosato-at commented 10 months ago

Sorry. I forgot to inform. I fixed flutter/bin/cache/artifacts/engine/elinux-common/cpp_client_wrapper/include/flutter/event_channel.h manually and then tried.

HidenoriMatsubayashi commented 10 months ago

I was unable to reproduce the issue.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      AndroidVideoPlayerApi.initialize (package:video_player_android/src/messages.g.dart:272)
<asynchronous suspension>

This is strange. VideoPlayer for eLinux doesn't use AndroidVideoPlayer though... Can you please try again on the top of the flutter-elinux main tree?

makotosato-at commented 10 months ago

Can you please try again on the top of the flutter-elinux main tree?

I tried but it did not work... The same issue occurred on another PC(x86_64/Ubuntu 22.04 LTS).

HidenoriMatsubayashi commented 10 months ago

Can you share whole logs?

flutter-elinux run -d elinux-x11 --release -vv
makotosato-at commented 10 months ago

I got the log. flutter_log.txt

HidenoriMatsubayashi commented 10 months ago

Hmm, it looks good. BTW, does this issue depend on flutter-elinux version?

makotosato-at commented 10 months ago

Hmm, it looks good. BTW, does this issue depend on flutter-elinux version?

It occurs in 3.13.0 or later. Works fine in 3.10.6.

HidenoriMatsubayashi commented 10 months ago

I was able to reproduce this issue on x64 Linux host. It appears it occurs only on x64 host. It works fine on arm64 host.

HidenoriMatsubayashi commented 10 months ago

This issue should be resolved in https://github.com/sony/flutter-elinux-plugins/pull/80. Can you please confirm if it's fixed in the latest plugin source files?

makotosato-at commented 10 months ago

Thank you. It works fine.

One thing I noticed. In x86 and release mode, Platform.operatingSystem returns 'android'. (3.13.0 or later) This may be the root of this issue. (returns 'linux' in 3.10.6)

HidenoriMatsubayashi commented 10 months ago

Thanks. I filed https://github.com/sony/flutter-elinux/issues/212.