ios - iOS swift Firestore 加载 gRPC-C++ 框架失败
问题描述
当我运行我的 firestore 代码时,开始就可以了。在使用模拟器或我的新手机运行时,无论我的 Firestore 版本如何,都会出现此异常:
有人说这与笔问题有关,但这不起作用。我不鼓励使用匿名登录吗?
这是我的代码:
Auth.auth().signInAnonymously() { (result , error) in
guard let authResult = result else {
return
}
let user = authResult.user
let isAnonymous = user.isAnonymous // true
if(isAnonymous){
let uid = user.uid
User.shared.userId = uid
print("user id : \(User.shared.userId)")
let userRef = db.collection("user").document(User.shared.userId)
userRef.getDocument { (querySnapshot, err) in
if let err = err {
print("Error getting documents: \(err)")
} else {
if (querySnapshot?.get("progress") == nil) {
var dataDict : Dictionary<String , Any> = [:]
dataDict["progress"] = 0
userRef.setData(dataDict)
}else{
let dict = querySnapshot?.data()
let sssresult = dict!.filter{ $0.key == "progress" }.first?.value as? Int ?? 0
User.shared.progress = sssresult
}
}
}
}
// Do any additional setup after loading the view.
}
// CocoaPods: try to load from the gRPC-C++ Framework.
NSBundle* _Nullable FindGrpcCppFrameworkBundle() {
return [NSBundle bundleWithIdentifier:@"org.cocoapods.grpcpp"];
}
解决方案
推荐阅读
- postgresql - Oracle 和 Postgres 客户端代码在同一个任务中?
- biztalk - 根据值将 Biztalk 平面文件消息分批成单独的分组平面文件
- html - 联系表格的定位问题(试图居中)
- amazon-redshift - 如何使用多个 DDL 语句执行文件
- redux - 在数组 redux 中更新数组
- r - 尝试安装 R 包“生命周期”时 loadNamespace 出错
- excel - 对活动单元格上方的单元格范围求和,单元格范围间隔为 3 列
- python - 如何使用 Python 将图像插入到现有 Word 文档中的特定位置?
- powerbi - 如何自定义 Power BI 模板应用的数据集
- c - 如何避免 // c 词法分析器使用 flex 的注释