【问题标题】:Error building iOS app with Flutter - Missing DVTPlugInCompatibilityUUID plugin使用 Flutter 构建 iOS 应用程序时出错 - 缺少 DVTPlugInCompatibilityUUID 插件
【发布时间】:2021-08-27 13:13:30
【问题描述】:

我在周末之前交付了一个构建,一切正常,我周一回来,无法构建。在过去的几天里,我一直被困在这个问题上,我一直在尝试互联网上的大部分东西,但似乎找不到解决方案。

XCode 构建未能指定缺少的插件(我猜是基本 Flutter 安装):

[        ] Xcode build done.                                           50.6s
[        ] Failed to build iOS app
[        ] Error output from Xcode build:
           ↳
[        ]     2021-06-10 09:23:10.255 xcodebuild[64069:7134747] [MT] PluginLoading: Required plug-in compatibility UUID F56A1938-53DE-493D-9D64-87EE6C415E4D for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPods.xcplugin' not present in DVTPlugInCompatibilityUUIDs
               2021-06-10 09:23:10.255 xcodebuild[64069:7134747] [MT] PluginLoading: Required plug-in compatibility UUID F56A1938-53DE-493D-9D64-87EE6C415E4D for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
               ** BUILD FAILED **

然后它会生成有关 Riverpod 的错误

               [+5009 ms] ../../flutter/.pub-cache/hosted/pub.dartlang.org/riverpod-0.12.4/lib/src/common.freezed.dart:121:4: Error: Getter not found: 'nullable'.
               [   +2 ms]   @nullable
               [        ]    ^^^^^^^^
               [   +5 ms] ../../flutter/.pub-cache/hosted/pub.dartlang.org/riverpod-0.12.4/lib/src/common.freezed.dart:121:4: Error: This can't be used as an annotation; an annotation should be a reference to a compile-time constant variable, or a call to a constant constructor.
               [        ]   @nullable
               [        ]    ^
               [   +1 ms] ../../flutter/.pub-cache/hosted/pub.dartlang.org/riverpod-0.12.4/lib/src/common.freezed.dart:206:4: Error: Getter not found: 'nullable'.
               [        ]   @nullable
               [        ]    ^^^^^^^^
               [        ] ../../flutter/.pub-cache/hosted/pub.dartlang.org/riverpod-0.12.4/lib/src/common.freezed.dart:206:4: Error: This can't be used as an annotation; an annotation should be a reference to a compile-time constant variable, or a call to a constant constructor.
               [        ]   @nullable
               [        ]    ^

到目前为止我所尝试的:

  • flutter clean
  • flutter pub cache repair
  • 重建 iOS 文件夹
  • 清理构建文件夹
  • pod update && pod install
  • flutter upgrade
  • 检查 !use_frameworks 在 podfile 中的使用情况

以及 XCode 中的其他配置更改,例如脚本“仅用于安装”等...

我看到的唯一情况是问题来自我正在使用的包,例如 Firebase Core。大约一年前他们遇到了类似的问题,我们必须降级软件包版本才能构建并且错误相似,这里的问题是我试图从 1.2.1 降级到 0.7.0 但问题一直存在到它会产生依赖性问题。 我认为flutter_svg也发生了同样的问题,这是由于一项重大更改导致必须更新flutter_svg或降级flutter。

另外,难道我还没有迁移到健全的 null 安全性?

如果您对如何调试有任何想法,那将非常有帮助。 (例如,我可以运行一些东西以获得有关错误的更多信息)。

这是我的颤振医生和 pubspec 文件:

颤振医生:

[✓] Flutter (Channel stable, 2.2.1, on macOS 11.3 20E232 darwin-x64, locale en-FR)
    • Flutter version 2.2.1 at /Users/Wapazz/Development/flutter
    • Framework revision 02c026b03c (2 weeks ago), 2021-05-27 12:24:44 -0700
    • Engine revision 0fdb562ac8
    • Dart version 2.13.1

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/Wapazz/Library/Android/sdk
    • Platform android-30, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

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

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (2 available)
    • iPhone 11 (mobile) • 519E686E-DEDD-4859-8D8D-EA775DB7149D • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 91.0.4472.77

• No issues found!

Pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  cloud_firestore: ^2.2.2
  country_code_picker: ^2.0.1
  dropdown_formfield: ^0.1.3
  file_picker: ^3.0.2+2
  firebase_auth: ^1.4.1
  firebase_core: ^1.3.0
  firebase_storage: ^8.1.3
  flat_segmented_control: ^0.1.0
  flutter_dialogs: ^1.1.0
  flutter_keyboard_visibility: ^5.0.2
  flutter_radar_chart: ^0.2.0
  flutter_riverpod: ^0.12.4 #^0.14.0+3
  flutter_svg: ^0.22.0
  google_fonts: ^2.1.0
  image_picker: ^0.8.0+3
  introduction_screen: ^2.1.0
  modal_bottom_sheet: ^2.0.0
  shimmer: ^2.0.0
  video_player: ^2.1.6
  youtube_player_flutter: ^8.0.0

编辑:它似乎来自ri​​verpod 0.12.4。 将其更新到最新版本会产生另一个错误,但需要代码重构,如果重构后问题得到解决,我会更新。

【问题讨论】:

    标签: ios xcode firebase flutter riverpod


    【解决方案1】:

    在逐个检查每个依赖项后,我找到了罪魁祸首。 该问题来自 Riverpod 0.12.4,将其更新到最新版本修复了该问题。

    此外,还需要进行重构以使应用正常运行并修复由于新 0.14.0 版本而导致的重大更改。

    Github issue regarding riverpod

    Migration guide

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-10
      • 2019-02-24
      • 2021-02-24
      • 2021-12-11
      • 2021-11-13
      • 2019-07-31
      • 2020-06-19
      • 1970-01-01
      相关资源
      最近更新 更多