flutter_ijkplayer icon indicating copy to clipboard operation
flutter_ijkplayer copied to clipboard

[Bug]升级Flutter到v1.12.13+hotfix.5后iOS真机运行报错

Open GanZhiXiong opened this issue 5 years ago • 1 comments

描述一下你遇到的 bug ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized. If you're running an application and nee

flutter 版本

[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.6 18G103, locale zh-Hans-CN)
    • Flutter version 1.12.13+hotfix.5 at /Users/ganzhixiong/development/flutter
    • Framework revision 27321ebbad (5 days ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/ganzhixiong/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3, Build version 11C29
    • CocoaPods version 1.7.5

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 39.0.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[!] IntelliJ IDEA Ultimate Edition (version 2019.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[!] VS Code (version 1.41.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

! Doctor found issues in 2 categories.

插件版本 flutter_ijkplayer 0.3.5+1

截图 image

注释掉main.dart中main函数里面await IjkManager.initIJKPlayer();这句代码就不报错了

GanZhiXiong avatar Dec 16 '19 10:12 GanZhiXiong

这个方法 是用来给 hot restart用的 因为我没找到热重启的回调 在某个版本的flutter sdk更新后, 理论上需要在需要在调用前添加WidgetsFlutterBinding.ensureInitialized();

void main() async{
  WidgetsFlutterBinding.ensureInitialized();
  await IjkManager.initIJKPlayer();
  runApp();
}

CaiJingLong avatar Jan 08 '20 02:01 CaiJingLong