gpt4 book ai didi

ios - 每当我添加 FlutterFire 包时,Firebase 就会停止工作

转载 作者:行者123 更新时间:2023-11-29 05:55:01 26 4
gpt4 key购买 nike

每当我尝试为 iOS 设置 firebase 时,一切都会正常工作,直到我将“cloud_firestore:”包(或任何其他 FlutterFire 包)添加到 pubspec.yaml 文件夹中。我每次都会收到类似的错误消息。唯一不会引发错误的与 firebase 相关的包是 firebase_core 包。我最常见的错误输出粘贴在下面:

*Xcode's output:

/Users/Jon/crud/ios/Pods/GoogleUtilities/GoogleUtilities/Network/GULNetw
orkURLSession.m:55:3: warning: 'NSURLSession' is only available on iOS
7.0 or newer [-Wunguarded-availability]
NSURLSession *__weak _Nullable _URLSession;
^
In module 'Foundation' imported from
/Users/Jon/crud/ios/Pods/GoogleUtilities/GoogleUtilities/Network/GULNetw
orkURLSession.m:15:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.pla
tform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/F
oundation.framework/Headers/NSURLSession.h:123:12: note: 'NSURLSession'
has been explicitly marked partial here
@interface NSURLSession : NSObject
^
In file included from
/Users/Jon/crud/ios/Pods/GoogleUtilities/GoogleUtilities/Network/GULNetw
orkURLSession.m:17:
/Users/Jon/crud/ios/Pods/GoogleUtilities/GoogleUtilities/Network/Private
/GULNetworkURLSession.h:33:12: note: annotate 'GULNetworkURLSession'
with an availability attribute to silence this warning
@interface GULNetworkURLSession : NSObject
^
1 warning generated.
/Users/Jon/crud/ios/Pods/FirebaseDatabase/Firebase/Database/Persistence/
FCachePolicy.m:17:9: fatal error: 'FCachePolicy.h' file not found
#import "FCachePolicy.h"
^~~~~~~~~~~~~~~~
1 error generated.*

我尝试使用 github 引用创建一个新的 FCachePolicy.h 文件夹并将其复制进去,但这只会导致向我报告未找到更多 Pods 文件的无尽列表。此时我既感到非常沮丧,又失去了想法 - 此时任何帮助或建议将不胜感激。

最佳答案

如果您添加 firestore 包,您还需要向项目添加 GoogleService-Info.plist

为此,您需要创建一个 Firebase 项目、添加您的 iOS bundle ID 并下载其他 plist 文件。

有关如何获取该文件以及如何将其添加到项目中的完整教程,您可以在此处的官方 Firebase Flutter Codelab 中获取(第 7 步):

https://codelabs.developers.google.com/codelabs/flutter-firebase/#6

关于ios - 每当我添加 FlutterFire 包时,Firebase 就会停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55251107/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com