Flutter Xcode构建失败,因为Flutter Form Builder有一些依赖问题

时间:2020-07-30 05:04:41

标签: ios xcode flutter formbuilder

我一直在试图解决这个问题:

Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    1 warning generated.
    /Users/ME/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:28: Error: Type 'DiagnosticableMixin' not found.
    class DatePickerTheme with DiagnosticableMixin {
                               ^^^^^^^^^^^^^^^^^^^
    /Users/ME/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
    class DatePickerTheme with DiagnosticableMixin {
          ^
    /Users/ME/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_form_builder-4.0.0-alpha.8/lib/src/fields/form_builder_chips_input.dart:95:17: Error: No named parameter with the name 'allowChipEditing'.
                    allowChipEditing: allowChipEditing,
                    ^^^^^^^^^^^^^^^^
    /Users/ME/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_chips_input-1.9.0-dev.1/lib/src/chips_input.dart:13:3: Context: Found this candidate, but the arguments don't match.
      ChipsInput({
      ^^^^^^^^^^

    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.

我正在使用flutter_form_builder-4.0.0-alpha.8 这是我的flutter doctor -v

[✓] Flutter (Channel dev, 1.21.0-1.0.pre, on Mac OS X 10.15.6 19G73, locale en-US)
    • Flutter version 1.21.0-1.0.pre at /Users/ME/development/flutter
    • Framework revision f25bd9c55c (2 weeks ago), 2020-07-14 20:26:01 -0400
    • Engine revision 99c2b3a245
    • Dart version 2.9.0 (build 2.9.0-21.0.dev 20bf2fcf56)
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Applications/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Applications/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

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

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 48.0.2-dev.4
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.47.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.8.0

[✓] Connected device (4 available)
    • iPhone 11 Pro Max (mobile)  • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
    • Web Server (web)           • web-server                               • web-javascript • Flutter Tools
    • Chrome (web)               • chrome                                   • web-javascript • Google Chrome

• No issues found!

我已经完成:

  1. 我可以做的所有事情:

    • 完成flutter clean,重建
    • 删除Pod然后执行flutter pub getpod setuppod install
    • flutter upgrade
  2. 删除并重新安装颤振,cocoapods,红宝石和飞镖

  3. 更改master和dev之间的抖动通道并重复点1。

  4. 还尝试使用pub.dev源和pub.flutter-io.cn。两者给出相同的结果。

现在在此问题上浪费了2天。所以我怀疑某些软件包或代码可能有问题吗?

感谢您的帮助!谢谢

1 个答案:

答案 0 :(得分:0)

最后,我通过以下方法解决了这个问题:

  1. 按照建议的hereDiagnosticableMixin中的Diagnosticable更改为flutter_datetime_picker-1.3.8

说明:显然,正在进行的讨论仍在进行中。文件flutter_datetime_picker-1.3.8.dart中有一个注释,如下所示:

将DiagnosticableMixin迁移到Diagnosticable,直到 https://github.com/flutter/flutter/pull/51495使其稳定(v1.15.21)

  1. form_builder_chips_input.dart中注释第95-97行:
allowChipEditing: allowChipEditing,
autofocus: autofocus,
focusNode: focusNode,

由于某些未知原因,这三个参数未在ChipsInput中定义

希望这对某人有帮助,因为我花了一些时间解决了这个问题,因为这些问题来自外部软件包。