chewie
chewie copied to clipboard
Unhandled Except ion: Bad state: Future already completed
There seems to be an issue that may be related to ... https://github.com/flutter/flutter/issues/29591 with video player.
But I am getting all of this wonky output in the console for "Bad state: Future already completed" and can't figure out how to fix it.
Here is flutter doctor -v:
[√] Flutter (Channel dev, v1.12.15, on Microsoft Windows [Version 6.3.9600], locale en-US) • Flutter version 1.12.15 at C:\Users\Johnny\flutter\flutter • Framework revision 459c7fb884 (5 weeks ago), 2019-11-26 17:04:51 +0000 • Engine revision e136d637a8 • Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0. 2) • Android SDK at C:\Users\Johnny\AppData\Local\Android\sdk • Android NDK location not configured (optional; useful for native profili ng support) • Platform android-29, build-tools 29.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03) • All Android licenses accepted.
[√] Android Studio (version 3.5) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 39.0.3 • Dart plugin version 191.8423 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.40.2) • VS Code at C:\Users\Johnny\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.7.0
[√] VS Code, 64-bit edition (version 1.22.1) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.7.0
[√] Connected device (1 available) • SM N960U • 258dabb0600c7ece • android-arm64 • Android 9 (API 28)
ΓÇó No issues found!
Here is the stack trace:
E/flutter (22236): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Except
ion: Bad state: Future already completed
E/flutter (22236): #0 _AsyncCompleter.complete (dart:async/future_impl.dart
:41:31)
E/flutter (22236): #1 VideoPlayerController.initialize (package:video_playe
r/video_player.dart:234:24)
E/flutter (22236):
VideoPlayerController is already initialized remove VideoPlayerController.initialize()
i faced the same error on iOS, i deleted autoplay and auto initialize on ChewieController my problem solved.
final networkVideo = networkVideos[pos]; _videoController = VideoPlayerController.network( networkVideos[pos].pitchingVideoUrl) ..initialize();
_chewieController = ChewieController( videoPlayerController: widget._videoPlayerController, looping: false, showControls: false, showControlsOnInitialize: false, aspectRatio: 0.6, errorBuilder: (context, errorMessage) { return Center( child: Text( errorMessage, style: TextStyle(color: Colors.white), ), ); }, );`
i faced the same error on iOS, i deleted autoplay and auto initialize on ChewieController my problem solved.
final networkVideo = networkVideos[pos]; _videoController = VideoPlayerController.network( networkVideos[pos].pitchingVideoUrl) ..initialize();_chewieController = ChewieController( videoPlayerController: widget._videoPlayerController, looping: false, showControls: false, showControlsOnInitialize: false, aspectRatio: 0.6, errorBuilder: (context, errorMessage) { return Center( child: Text( errorMessage, style: TextStyle(color: Colors.white), ), ); }, );`
It does not work for me.
same issue with me
i faced the same error on iOS, i deleted autoplay and auto initialize on ChewieController my problem solved.
final networkVideo = networkVideos[pos]; _videoController = VideoPlayerController.network( networkVideos[pos].pitchingVideoUrl) ..initialize();_chewieController = ChewieController( videoPlayerController: widget._videoPlayerController, looping: false, showControls: false, showControlsOnInitialize: false, aspectRatio: 0.6, errorBuilder: (context, errorMessage) { return Center( child: Text( errorMessage, style: TextStyle(color: Colors.white), ), ); }, );`
This is worked for me!