ios - 添加依赖后 Flutter 构建失败
问题描述
在我尝试安装flutter_statusbarcolor包后构建失败。在我做之前一切都很好,我正在使用 Mac 和 XCode 模拟器。我只想更改状态栏的颜色。这种方法行不通。
$ 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ʀ.
然后我从依赖项和~/.pub-cache/hosted/pub.dartlang.org/
目录中的所有文件中删除了这个包。但是 Flutter 仍然会抛出同样的错误。如何恢复我的应用程序并原生更改状态栏的颜色?
解决方案
这帮助了我:
转到 ios 目录并输入
pod install
参考:https ://github.com/X-Wei/flutter_catalog/issues/26#issuecomment-548923989
推荐阅读
- python - 如何仅从给定的起点将文本文件中的数据附加到列表中,而不是使用 python 附加完整文件
- google-chrome - 使用 Chrome 扩展来调整未停靠的开发工具窗口的大小
- c# - Selenium C# 版本错误,但仅在应用程序发布时。(此版本的 ChromeDriver 仅支持...)
- javascript - flowtype,如何以类型安全的方式进行猴子补丁?
- android - 使用 Apksigner 时出现“未找到中央目录记录的 ZIP 结尾”错误
- jira - 如何通过只有父页面标题的 Confluence REST API 创建子页面
- javascript - 筹码值得到 [object Object]
- python - 我们如何使列表中的元素在python中多次倒退?
- django - 我在哪里可以在 django 中存储刷新和访问令牌
- python-3.x - 403 客户端错误:禁止访问 url:https://ropsten.infura.io/v3/PROJECT_ID