swift - FIRAuth 文件与 FirebaseUI 不兼容 : use of undeclared identifier 'FIRAuthErrorUserInfoUpdatedCredentialKey'

标签 swift firebase firebase-authentication cocoapods firebaseui

我最近刚刚更新了 podfile,添加了两个条目 pod 'Firebase/Storage'pod 'FirebaseUI/Storage'。当我添加这两个条目时,当我在 Xcode 中打开我的项目时,构建失败,并收到以下错误:

Use of undeclared identifier 'FIRAuthErrorUserInfoUpdatedCredentialKey'; did you mean 'FIRAuthUpdatedCredentialKey'?
Replace 'FIRAuthErrorUserInfoUpdatedCredentialKey' with 'FIRAuthUpdatedCredentialKey'

此错误是在 FUIAuth.m 中发现的。查看 FirebaseAuth 的 GitHub 项目,我看到 FIRAuthErrorUserInfoUpdatedCredentialKey 应该在 FIRAuthErrors.h 文件 ( https://github.com/firebase/firebase-ios-sdk/blob/master/Firebase/Auth/Source/Public/FIRAuthErrors.h ) 中定义,但我当前拥有的文件与GitHub 项目中的一个。我不太确定应该如何设置 podfile 才能正确地使这些 pod 一起工作。 这是我的 podfile 的内容:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'AppName' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ChurchSearch
  pod 'Firebase/Core'
  pod 'Firebase/Firestore'
  pod 'Firebase/Auth'
  pod 'Firebase/Storage'
  pod 'FirebaseUI/Storage'
  pod 'FirebaseUI/Auth'

  pod 'FirebaseUI/Google'
  pod 'FirebaseUI/Facebook'
  pod 'FirebaseUI/Twitter'

  pod ‘Geofirestore'

  target 'AppNameTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

然后这是我在终端上得到的信息:

Analyzing dependencies
Downloading dependencies
Using Bolts (1.9.0)
Using BoringSSL-GRPC (0.0.3)
Using FBSDKCoreKit (4.44.1)
Using FBSDKLoginKit (4.44.1)
Using Firebase (5.4.1)
Using FirebaseAnalytics (5.0.1)
Using FirebaseAuth (5.0.2)
Using FirebaseCore (5.0.6)
Using FirebaseDatabase (5.0.2)
Using FirebaseFirestore (0.12.6)
Using FirebaseInstanceID (3.1.1)
Using FirebaseStorage (3.0.0)
Using FirebaseUI (6.2.1)
Using GTMSessionFetcher (1.2.1)
Using GeoFire (3.0.0)
Using Geofirestore (0.1.0)
Using GoogleSignIn (4.4.0)
Using GoogleToolboxForMac (2.2.0)
Using GoogleUtilities (5.8.0)
Using Protobuf (3.7.0)
Using TwitterCore (3.2.0)
Using TwitterKit (3.4.2)
Using gRPC (1.20.0)
Using gRPC-Core (1.20.0)
Using gRPC-ProtoRPC (1.20.0)
Using gRPC-RxLibrary (1.20.0)
Using leveldb-library (1.20)
Using nanopb (0.3.901)
Generating Pods project
Integrating client project
Sending stats

我还尝试清洁和删除 Pod 并重新安装,但这并没有改变任何东西。我也曾一度运行过pod repo update,我不知道这是否会导致问题。有谁知道我做错了什么,或者我如何才能使这些正常工作?

最佳答案

我终于成功了。我认为我的实际问题是,在 pod 存储库更新之后,FirebaseUI 从 5.2.2 更新到了 6.2.1。由于某种原因,cocoapods 认为 FirebaseUI 6.2.1 与 FirebaseAuth 5.2.0 兼容。这些不兼容。如果您尝试同时使用这两个库,您将收到上述错误。因此,我删除了 podfile.lock,并再次运行 pod deintegrate 来清除所有内容。然后我将 pod FirebaseUI, '5.2.2' 添加到我的 podfile,运行 pod install,它成功了!

我另外将我的 cocoapods 从 1.5.3 更新到 1.6.1,这可能也有帮助。

关于swift - FIRAuth 文件与 FirebaseUI 不兼容 : use of undeclared identifier 'FIRAuthErrorUserInfoUpdatedCredentialKey' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55843220/

相关文章:

Android - Firebase 身份验证失败

ios - Swift iOS 客户端证书认证

ios - 在 Swift 2 中创建异步任务

javascript - 离线的json文件可以被chart.js读取,但是在线的json无法读取

android - 通知用户更新 Google Play 服务

java - Firebase 实时数据库 long 值始终返回 0,即使它不是

android - Firebase verifyIdToken 错误 : Decoding Firebase ID token failed.

string - 从 CLPlacemark 创建地址字符串

ios - 类型 'ViewController' 不符合协议(protocol) 'MDCSwipeToChooseDelegate'

javascript - 如何在 HTML 表格上显示带有多级键的 Firebase 数据?