一直报错Error running pod install Downloading dependencies
-> Installing Flutter (1.0.0)
-> Installing Protobuf (3.11.4)
> Copying Protobuf from `/Users/xumin/Library/Caches/CocoaPods/Pods/Release/Protobuf/3.11.4-17622` to `Pods/Protobuf`
-> Installing flutter_blue (0.0.1)
- Running pre install hooks
Generating Pods project
- Creating Pods project
- Installing files into Pods project
- Adding source files
- Adding frameworks
- Adding libraries
- Adding resources
- Adding development pod helper files
- Linking headers
- Installing Pod Targets
- Installing target `Flutter` iOS 8.0
- Installing target `Protobuf` iOS 7.0
- Generating dummy source at `Pods/Target Support Files/Protobuf/Protobuf-dummy.m`
- Installing target `flutter_blue` iOS 8.0
- Generating module map file at `Pods/Target Support Files/flutter_blue/flutter_blue.modulemap`
- Generating umbrella header at `Pods/Target Support Files/flutter_blue/flutter_blue-umbrella.h`
- Generating dummy source at `Pods/Target Support Files/flutter_blue/flutter_blue-dummy.m`
- Installing Aggregate Targets
- Installing target `Pods-Runner` iOS 9.0
- Generating dummy source at `Pods/Target Support Files/Pods-Runner/Pods-Runner-dummy.m`
- Generating deterministic UUIDs
- Stabilizing target UUIDs
- Running post install hooks
[!] An error occurred while processing the post-install hook of the Podfile.
undefined method `headers_build_phase' for #<Xcodeproj::Project::Object::PBXAggregateTarget:0x00007fafc3aa2290>
省略很多..... Error running pod install
Error launching application on iPhone 8.
可能思路
1,你的电脑如果装有多个ruby版本,使用pod的时候,必须选择你安装时候的ruby 版本。如,2.3.4和2.7.1,使用ruby use 版本命令
2,看清楚自己创建的项目是OBJC和Swift版本,flutter_blue问题很有可能是因为创建的是swift版本的IOS项目,可以用xcode打开IOS项目,如果有Appdelegate.swift,那就是swift,如果是AppDelegate.h和.m的话,那就是OC项目.使用fultter create -i objc 项目名称,比如 flutter create -i objc flutter_demo。
一般都是第二个原因导致的。可以查看github.com/pauldemarco… 这里面更加详细