【问题标题】:Flutter build failed after adding dependency添加依赖后 Flutter 构建失败
【发布时间】:2020-01-30 20:10:53
【问题描述】:

在我尝试安装 flutter_statusbarcolor 包后构建失败。在我做之前一切都很好,我正在使用 Mac 和 XCode 模拟器。我只想更改状态栏的颜色。 This approach 不起作用。

$ flutter run
Launching lib/main.dart on iPhone Xʀ in debug mode...
Running Xcode build...                                                  
Xcode build done.                                            1,3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    note: Using new build systemnote: Planning buildnote: Constructing build descriptionerror: /Users/Bob/Documents/Projects/Flutter/gp/ios/Flutter/Debug.xcconfig:1: could not find included file
    'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner' from project 'Runner')error:
    /Users/Bob/Documents/Projects/Flutter/gp/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target
    'Runner' from project 'Runner')error: /Users/Bob/Documents/Projects/Flutter/gp/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
    Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner' from project 'Runner')error: /Users/Bob/Documents/Projects/Flutter/gp/ios/Flutter/Debug.xcconfig:1: could not find
    included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner' from project 'Runner')error:
    /Users/Bob/Documents/Projects/Flutter/gp/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target
    'Runner' from project 'Runner')error: /Users/Bob/Documents/Projects/Flutter/gp/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support
    Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner' from project 'Runner')

Could not build the application for the simulator.
Error launching application on iPhone Xʀ.

Then 我从依赖项和~/.pub-cache/hosted/pub.dartlang.org/ 目录中的所有文件中删除了这个包。但是 Flutter 仍然会抛出同样的错误。如何恢复我的应用程序并原生更改状态栏的颜色?

【问题讨论】:

  • 你使用哪个版本的依赖?
  • 正如它在pub.dev flutter_statusbarcolor: ^0.2.2 中提到的那样
  • 尝试使用旧版本,例如 0.2.0

标签: ios flutter dart flutter-dependencies dart-pub


【解决方案1】:

这对我有帮助:

转到 ios 目录并输入 pod install

参考:https://github.com/X-Wei/flutter_catalog/issues/26#issuecomment-548923989

【讨论】:

    【解决方案2】:

    可能缺少依赖项

    为了修复,您需要获取软件包并安装 pod。

    1. 打开终端,导航到项目并输入
    2. flutter clean
    3. flutter pub get
    4. 运行pod install

    【讨论】:

      【解决方案3】:

      添加

      path_provider: 1.6.1 
      

      pubspec.yaml 然后 那么

      flutter pub get
      

      【讨论】:

        猜你喜欢
        • 2020-05-14
        • 2018-08-16
        • 1970-01-01
        • 2019-11-21
        • 1970-01-01
        • 2018-11-28
        • 2020-10-23
        • 2021-06-16
        • 2019-08-27
        相关资源
        最近更新 更多