abdelaziz-mahdy / flutter_meedu_videoplayer

Cross-Platform Video Player for flutter
https://abdelaziz-mahdy.github.io/flutter_meedu_videoplayer/
MIT License
132 stars 69 forks source link

Unable to launch app with Flutter 3.13 #162

Closed Mario359 closed 10 months ago

Mario359 commented 10 months ago

Hello, today I have updated my project to Flutter 3.13.0 from Flutter 3.10.6 and Meedu videoplayer seems to not work properly with this version of Flutter.

I have created a new project with this package only and it still stop on launch

Error: Error connecting to the service protocol: failed to connect to http://127.0.0.1:60201/EyVDbLu8yCU=/ Full error:

[  +70 ms] Connecting to service protocol: http://127.0.0.1:60658/-IKGTKRilio=/
[  +33 ms] Fail to connect to service protocol: http://127.0.0.1:60658/-IKGTKRilio=/: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:60658/-IKGTKRilio=/ws
[   +3 ms] Error connecting to the service protocol: failed to connect to http://127.0.0.1:60658/-IKGTKRilio=/
[  +16 ms] "flutter run" took 62โ€ฏ028ms.
[   +7 ms]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:760:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1297:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:339:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:285:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:115:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>

[ +113 ms] ensureAnalyticsSent: 96ms
[   +1 ms] Running 1 shutdown hook
[  +13 ms] Shutdown hooks complete
[   +1 ms] exiting with code 2

On Windows: image This error is showing on Android and Windows, it seems that the app is installed but cannot start and abort connection

It works fine on Web, MacOS and iOS

abdelaziz-mahdy commented 10 months ago

Are you using media_kit on Android? And the latest version?

Since the problem is at launching the app it may be a problem on their side

If it doesn't compile the stack from this package then it's a problem with this package,

Anyway I will test tomorrow, and let you know if I found a fix, or if I figure out the cause of it and if it's a media_kit problem I will open an issue there

Mario359 commented 10 months ago

I haven't implemented media_kit on my projects, I added the video_player package

abdelaziz-mahdy commented 10 months ago

Media_kit by default is used in windows so that explains windows, but this doesn't explain android

So it may be something else, when I test I will let you know, sadly I can't do that now

annd22 commented 10 months ago

confirm this happen on windows 11 (normal on windows 10), from 3.10.6. if I remove the meedu lib, everythings is ok.

abdelaziz-mahdy commented 10 months ago

@annd22 I have windows 10, can you try media_kit and let me know if it does crash there or not?

Like the main example they have,

Also

does flutter upgrade help?

annd22 commented 10 months ago

@annd22 I have windows 10, can you try media_kit and let me know if it does crash there or not?

Like the main example they have,

Also

does flutter upgrade help?

abdelaziz-mahdy commented 10 months ago

@annd22 I have windows 10, can you try media_kit and let me know if it does crash there or not?

Like the main example they have,

Also

does flutter upgrade help?

  • did you mean that remove flutter_meedu_videoplayer and import media_kit only?

Replace with flutter_meedu_media_kit and just comment what doesn't exist

Wait a moment it happens on windows on launch right? Without opening any players??? If that's the case can you comment initmeedu? Maybe window manger is the one causing the crash

bryanjorgeflores commented 10 months ago

I have the same problem, deleting the package allows me to debug. I also tried the media kit one an it has the same error

Hello, today I have updated my project to Flutter 3.13.0 from Flutter 3.10.6 and Meedu videoplayer seems to not work properly with this version of Flutter.

I have created a new project with this package only and it still stop on launch

Error: Error connecting to the service protocol: failed to connect to http://127.0.0.1:60201/EyVDbLu8yCU=/ Full error:

[  +70 ms] Connecting to service protocol: http://127.0.0.1:60658/-IKGTKRilio=/
[  +33 ms] Fail to connect to service protocol: http://127.0.0.1:60658/-IKGTKRilio=/: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:60658/-IKGTKRilio=/ws
[   +3 ms] Error connecting to the service protocol: failed to connect to http://127.0.0.1:60658/-IKGTKRilio=/
[  +16 ms] "flutter run" took 62โ€ฏ028ms.
[   +7 ms]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:760:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1297:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:339:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:285:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:115:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>

[ +113 ms] ensureAnalyticsSent: 96ms
[   +1 ms] Running 1 shutdown hook
[  +13 ms] Shutdown hooks complete
[   +1 ms] exiting with code 2

On Windows: image This error is showing on Android and Windows, it seems that the app is installed but cannot start and abort connection

It works fine on Web, MacOS and iOS

abdelaziz-mahdy commented 10 months ago

Can I ask you to try media_kit example on their repo? I am trying to pinpoint the crash cause

Window_manager or media_kit

If you can try both packages examples that will help greatly since one will crash,

Since I couldnt replicate it ๐Ÿ˜ข

Also I am planning to update the package to the latest version of media_kit tonight, hopefully that fixes it.

annd22 commented 10 months ago

I tried on windows 11, flutter 3.10.6 (on windows 10 still works normally): image

@annd22 I have windows 10, can you try media_kit and let me know if it does crash there or not? Like the main example they have, Also does flutter upgrade help?

  • did you mean that remove flutter_meedu_videoplayer and import media_kit only?

Replace with flutter_meedu_media_kit and just comment what doesn't exist

Wait a moment it happens on windows on launch right? Without opening any players??? If that's the case can you comment initmeedu? Maybe window manger is the one causing the crash

abdelaziz-mahdy commented 10 months ago

I tried on windows 11, flutter 3.10.6 (on windows 10 still works normally): image

  • remove flutter_meedu_video_player : build debug success โœ…
  • remove flutter_meedu_video_player and replace with flutter_meedu_media_kit 4.2.24+1: build debug failed โŒ
  • only remove meedu init function MediaKit.ensureInitialized(); and initVideoPlayerMediaKitIfNeeded();: build debug failed โŒ image

@annd22 I have windows 10, can you try media_kit and let me know if it does crash there or not? Like the main example they have, Also does flutter upgrade help?

  • did you mean that remove flutter_meedu_videoplayer and import media_kit only?

Replace with flutter_meedu_media_kit and just comment what doesn't exist

Wait a moment it happens on windows on launch right? Without opening any players??? If that's the case can you comment initmeedu? Maybe window manger is the one causing the crash

Right now I don't know the problem, can you please both window_manager and media_kit packages examples?

annd22 commented 10 months ago

I think its the media_kit. My project contains window_manager as well, and you can see the 2 cases above:

remove flutter_meedu_video_player : build debug success โœ…
remove flutter_meedu_video_player and replace with flutter_meedu_media_kit 4.2.24+1: build debug failed โŒ

So we can have the conclusion is adding flutter_meedu_media_kit to a project - which contains window_manager before (and build normally) -> bug

abdelaziz-mahdy commented 10 months ago

I think its the media_kit. My project contains window_manager as well, and you can see the 2 cases above:

remove flutter_meedu_video_player : build debug success โœ…
remove flutter_meedu_video_player and replace with flutter_meedu_media_kit 4.2.24+1: build debug failed โŒ

So we can have the conclusion is adding flutter_meedu_media_kit to a project - which contains window_manager before (and build normally) -> bug

Then I do release with the latest version of media_kit and see if that helps

AnonymHK commented 10 months ago

I also encountered the same problem, and after updating Flutter to 3.13, I also encountered the problem!

Error connecting to the service protocol: failed to connect to http://127.0.0.1:57693/cYuSJUuWHkc=/

Doctor summary (to see all details, run flutter doctor -v): [โˆš] Flutter (Channel stable, 3.13.0, on Microsoft Windows [็‰ˆๆœฌ 10.0.19044.1889], locale zh-CN) [โˆš] Windows Version (Installed version of Windows is version 10 or higher) [โˆš] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [โˆš] Chrome - develop for the web [โˆš] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.5) [โˆš] Android Studio (version 2022.3) [โˆš] VS Code (version 1.70.0) [โˆš] Connected device (4 available) [โˆš] Network resources

I tried to rollback the Flutter version and cleared the cache, but the problem persists! I created an example using the new version of Flutter and it works properly! Flutter Meedu Videoplayer_ Error running example:

โˆš Build build app outputs floppy apk app debug.apk

Installing build app outputs lutter apk app debug.apk

Error connecting to the service protocol: failed to connect to http://127.0.0.1:57693/cYuSJUuWHkc=/

My other Flutter projects are working properly!

AnonymHK commented 10 months ago

After running, the app will appear blank and exit!

abdelaziz-mahdy commented 10 months ago

opened an issue in media_kit https://github.com/media-kit/media-kit/issues/378 hopefully they understand the cause better and find a better solution

but for now, can you guys try this and let me know if it fixed it for you

for media_kit_libs_android_video put it only if you enabled media_kit for android

also do a flutter upgrade before launching to get latest video_player_media_kit lib

dependency_overrides:
    media_kit: 1.1.2+1                              # Primary package.

    media_kit_video: 1.1.2                        # For video rendering.

    media_kit_libs_android_video: 1.3.0           # Android package for video native libraries.
AnonymHK commented 10 months ago

opened an issue in media_kit https://github.com/media-kit/media-kit/issues/378 hopefully they understand the cause better and find a better solution

but for now, can you guys try this and let me know if it fixed it for you

for media_kit_libs_android_video put it only if you enabled media_kit for android

also do a flutter upgrade before launching to get latest video_player_media_kit lib

dependency_overrides: media_kit: 1.1.2+1 # Primary package.

media_kit_video: 1.1.2                        # For video rendering.

media_kit_libs_android_video: 1.3.0           # Android package for video native libraries.    
media_kit_libs_android_video: 1.3.0           # Android package for video native libraries.

This solution has solved my problem! Examples are running normally now!

AnonymHK commented 10 months ago

By the way, consider upgrading the components under dependencies. Here is the latest stable version:

video_player_media_kit 0.0.24 volume_controller: ^2.0.7 screen_brightness: ^0.2.2 flutter_meedu: ^8.3.1 flutter_spinkit: ^5.2.0 shared_preferences: ^2.2.0 path_provider: ^2.1.0

abdelaziz-mahdy commented 10 months ago

The reason the overrides work is that on latest version of media_kit

The find_packages module closes the app whenever it finds any package that uses media_kit in it's name which is not made by media_kit themselves,

I think a better solution in their case is to just display a warning to developers instead of closing the app if the idea is to let people know it's not made by media_kit themselves.

Let's see what they will say in the issue I opened (since I am just assuming that's what they want to do)

bryanjorgeflores commented 10 months ago

Using the overrides fix the launch but now I get the next error:

image
abdelaziz-mahdy commented 10 months ago

Using the overrides fix the launch but now I get the next error:

image

Is that on Android? And you are using flutter_meedu_media_kit

Did you call mediakit ensure init? You can find it
flutter_meedu_media_kit example

bryanjorgeflores commented 10 months ago

Using the overrides fix the launch but now I get the next error:

image

Is that on Android? And you are using flutter_meedu_media_kit

Did you call mediakit ensure init? You can find it flutter_meedu_media_kit example

Yeah Iยดm in android, I return to flutter_meedu_videoplayer cause i was trying the media_kit one. Now it's working fine, thank you!

abdelaziz-mahdy commented 10 months ago

I will update the package for now to use these versions to avoid the overrides, until media_kit resolves it.

AnonymHK commented 10 months ago

consider upgrading the components under dependencies. Here is the latest stable version:

video_player_media_kit 0.0.24 volume_controller: ^2.0.7 screen_brightness: ^0.2.2 flutter_meedu: ^8.3.1 flutter_spinkit: ^5.2.0 shared_preferences: ^2.2.0 path_provider: ^2.1.0

Consider upgrading the components under dependencies. Here is the latest stable version:

video_player_media_kit 0.0.24 volume_controller: ^2.0.7 screen_brightness: ^0.2.2 flutter_meedu: ^8.3.1 flutter_spinkit: ^5.2.0 shared_preferences: ^2.2.0 path_provider: ^2.1.0

abdelaziz-mahdy commented 10 months ago

consider upgrading the components under dependencies. Here is the latest stable version:

video_player_media_kit 0.0.24 volume_controller: ^2.0.7 screen_brightness: ^0.2.2 flutter_meedu: ^8.3.1 flutter_spinkit: ^5.2.0 shared_preferences: ^2.2.0 path_provider: ^2.1.0

Consider upgrading the components under dependencies. Here is the latest stable version:

video_player_media_kit 0.0.24 volume_controller: ^2.0.7 screen_brightness: ^0.2.2 flutter_meedu: ^8.3.1 flutter_spinkit: ^5.2.0 shared_preferences: ^2.2.0 path_provider: ^2.1.0

If it's not a major release flutter upgrade will work for all people,

I try to avoid using latest version unless it fixes a bug in this package since it may cause conflicts with other people's packages.

abdelaziz-mahdy commented 10 months ago

i opened https://github.com/media-kit/media-kit/pull/382 hopefully they dont mind the change

abdelaziz-mahdy commented 10 months ago

also new release is live, check it (should not need a dependency_overrides)

also if you enabled media_kit for android use media_kit_libs_android_video: 1.3.0

annd22 commented 10 months ago

updated to flutter_meedu_videoplayer: ^4.2.25 but still get the error on windows 11, flutter 3.10.6

AnonymHK commented 10 months ago

updated to flutter_meedu_videoplayer: ^4.2.25 but still get the error on windows 11, flutter 3.10.6

flutter upgrade flutter clean

annd22 commented 10 months ago

I tried, now flutter is 3.13, and still get error

updated to flutter_meedu_videoplayer: ^4.2.25 but still get the error on windows 11, flutter 3.10.6

flutter upgrade flutter clean

abdelaziz-mahdy commented 10 months ago

I tried, now flutter is 3.13, and still get error

updated to flutter_meedu_videoplayer: ^4.2.25 but still get the error on windows 11, flutter 3.10.6

flutter upgrade flutter clean

On Android or windows? And does the overide work or not?

annd22 commented 10 months ago

on windows 11, I tried with and without dependency_overrides, and both not working image

abdelaziz-mahdy commented 10 months ago

on windows 11, I tried with and without dependency_overrides, and both not working image

Sadly I don't have a way to test windows 11 to figure out the cause of it

Since it happens on both versions of flutter it may be safe to assume it's related to media_kit

Can you try to override the media_kit windows video libs, media_kit_libs_windows_video: 1.0.6

And if it didn't work try 1.0.5

And let me know which works for you

annd22 commented 10 months ago
dependency_overrides:
  media_kit_libs_windows_video: 1.0.6   

this works, thank you ๐Ÿ‘

abdelaziz-mahdy commented 10 months ago
dependency_overrides:
  media_kit_libs_windows_video: 1.0.6   

this works, thank you ๐Ÿ‘

Okay so as I thought the latest release of everything has the find packages module in which it crashes on launch

Hope they fix that with a warning instead of the exit

abdelaziz-mahdy commented 10 months ago
dependency_overrides:
  media_kit_libs_windows_video: 1.0.6   

this works, thank you ๐Ÿ‘

published new release.

abdelaziz-mahdy commented 10 months ago

please check new release

Mario359 commented 10 months ago

I confirm it works on Windows 11 and Android, this issue can now be closed