我正在尝试构建一个Flutter应用程序,该应用程序使用Firestore、Cloud Functions和Auth上传到app Store。我可以使用Flutter为iOS构建,但在XCode中为通用设备构建失败。在一大堆关于找不到各种pod的目录的警告之后,构建在链接阶段失败,并出现错误:
ld: warning: directory not found for option '-L/Users/jpsheehan/Library/Developer/Xcode/DerivedData/Runner-dbsrfhxjslbqvrhhrsdoiilfifvz/Build/Products/Release-production-iphoneos/AppAuth'
ld: warning: directory not found for option '-L/Users/jpsheehan/Library/Developer/Xcode/DerivedData/Runner-dbsrfhxjslbqvrhhrsdoiilfifvz/Build/Products/Release-production-iphoneos/BoringSSL-GRPC'
ld: warning: directory not found for option '-L/Users/jpsheehan/Library/Developer/Xcode/DerivedData/Runner-dbsrfhxjslbqvrhhrsdoiilfifvz/Build/Products/Release-production-iphoneos/FirebaseAuth'
...
ld: library not found for -lAppAuth
我尝试过以下事情,但没有成功:
- 打开
Runner.xcworkspace
,而不是Runner.xcproject
- 删除
Podfile
、Podfile.lock
和Pods
- 将
Pods.xcworkspace
拖动到XCode中的Pods
文件夹中
有人建议如何解决这个问题吗?
问题是在我添加flatter的口味后,我的配置文件没有包括正确的Pods Runner文件。我修改了它们以指向正确的路径。
损坏版本
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
工作版本
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-production.xcconfig"
#include "Generated.xcconfig"
我花了几个小时试图修复这个错误。最终,这就是我解决问题的方法
- 在开始使用Xcode Archive之前,使用flutter构建iOS
- 将IOS部署目标更改为更高的目标IOS 11.2。早些时候,我有一个类似8.0的版本,它给出了以上所有错误
- 确保Xcode中的IOS部署目标在Project、Target和Pods中相同