播放器章节chewie和video_player编译就报错

来源:7-4 Flutter视频播放器组件封装

慕斯8541433

2021-04-28

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...
Xcode build done.                                           14.0s
Failed to build iOS app
Error output from Xcode build:
↳
    objc[41676]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x200278188) and ?? (0x11894c2b8). One of the two will be used. Which one is undefined.
    objc[41676]: Class AMSupportURLSession is implemented in both ?? (0x2002781d8) and ?? (0x11894c308). One of the two will be used. Which one is undefined.
    ** BUILD FAILED **


Xcode's output:
↳
    ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/wakelock_platform_interface-0.2.0/lib/messages.dart:100:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
     - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('../../flutter/packages/flutter/lib/src/services/platform_channel.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
            channel.setMockMessageHandler(null);
                    ^^^^^^^^^^^^^^^^^^^^^
    ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/wakelock_platform_interface-0.2.0/lib/messages.dart:102:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
     - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('../../flutter/packages/flutter/lib/src/services/platform_channel.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
            channel.setMockMessageHandler((dynamic message) async {
                    ^^^^^^^^^^^^^^^^^^^^^
    ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/wakelock_platform_interface-0.2.0/lib/messages.dart:114:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
     - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('../../flutter/packages/flutter/lib/src/services/platform_channel.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
            channel.setMockMessageHandler(null);
                    ^^^^^^^^^^^^^^^^^^^^^
    ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/wakelock_platform_interface-0.2.0/lib/messages.dart:116:17: Error: The method 'setMockMessageHandler' isn't defined for the class 'BasicMessageChannel<dynamic>'.
     - 'BasicMessageChannel' is from 'package:flutter/src/services/platform_channel.dart' ('../../flutter/packages/flutter/lib/src/services/platform_channel.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'.
            channel.setMockMessageHandler((dynamic message) async {
                    ^^^^^^^^^^^^^^^^^^^^^

    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    /Users/xxx/AndroidStudioProjects/flutter_bilibili_app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Toast' from project 'Pods')
    /Users/xxx/AndroidStudioProjects/flutter_bilibili_app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'FMDB' from project 'Pods')
    /Users/xxx/AndroidStudioProjects/flutter_bilibili_app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.

封装好初始VideoView,使用VideoView就编译不了。
开发环境是,M1 Mac,跑自带模拟器

写回答

1回答

CrazyCodeBoy

2021-04-28

chewie依赖的wakelock_platform_interface 0.2.0 插件和你当前flutter版本不兼容,应该是你的flutter版本太高wakelock_platform_interface还没适配导致的,将flutter 版本切换到stable或dev分支上然后运行试试:

flutter channel dev
flutter upgrade


2
0

Flutter高级进阶实战-仿哔哩哔哩-掌握Flutter高阶技能

一次性掌握Flutter高阶技能+商业级复杂项目架构设计与开发方案

1722 学习 · 870 问题

查看课程