Flutter:在我的 Mac 上为 iOS 构建应用程序时出现问题

Flutter: issue when building the app for iOS on my Mac

构建过程有点奇怪——在复制 flutter blue 库时——引用了一个不存在的文件夹:

error: open /development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue_plus-1.1.2/ios/gen/Flutterblueplus.pbobjc.h: No such file or directory (in target 'flutter_blue_plus' from project 'Pods')

实际复制步骤如下:

PBXCp /Users/stephanedeluca/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue_plus-1.1.2/ios/gen/Flutterblueplus.pbobjc.h /development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue_plus-1.1.2/ios/gen/Flutterblueplus.pbobjc.h (in target 'flutter_blue_plus' from project 'Pods')
    cd /Users/stephanedeluca/Documents/dsei/XXXXX/ios/Pods
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/stephanedeluca/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue_plus-1.1.2/ios/gen/Flutterblueplus.pbobjc.h /development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blue_plus-1.1.2/ios/gen

我看到的是该文件使用正确的文件夹前缀(又名 ~/development)被引用一次,但在直接从 /development 文件夹引用后省略了用户位置前缀。

我该如何解决?

最后我发现你们只需要:

$ flutter upgrade $ flutter pub get

在 XCode 中打开您的 Flutter 项目中的 IOS 文件夹。 然后去Pods。在“目标”部分,select:

flutter_blue_plus > 构建阶段 > 复制../../../Developer/flutter/.pub-cache

在子路径中,在 /Developer

之前添加您的 Mac 用户名

例如myusername/Developer/flutter/...