FIRAuth 文件与 FirebaseUI 不兼容:使用未声明的标识符 'FIRAuthErrorUserInfoUpdatedCredentialKey'

FIRAuth files not compatible with FirebaseUI: use of undeclared identifier 'FIRAuthErrorUserInfoUpdatedCredentialKey'

我最近更新了我的播客文件并添加了两个条目 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 以正确地使这些 pods 一起工作。 这是我的播客文件的内容:

# 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

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

我终于搞定了。我认为我的实际问题是,在 pod repo update 之后,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,这可能也有帮助。