FIRSTORE INTERNAL ASSERTION FAILED:无法从捆绑软件中加载根证书。 SSL无法运作

时间:2019-03-20 12:51:47

标签: xcode react-native google-cloud-firestore

我正在开发一个React Native Application,我已经设法在android平台上运行它而没有任何问题。但是我在xcode中遇到错误。它正在构建项目并运行它,但是在我通过了Firebase身份验证部分之后,它会导致失败。

失败:

*** Assertion failure in std::string firebase::firestore::remote::LoadGrpcRootCertificate()(), ..myProject/ios/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder_apple.mm:61
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: Could not load root certificates from the bundle. SSL cannot work. (expected path)'

我的Podfile:

# File contents of "ios/Podfile"
platform :ios, '9.0'

target 'myProject' do
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
    # the following ones are the ones taken from "Libraries" in Xcode:
    'RCTAnimation',
    'RCTActionSheet',
    'RCTBlob',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket'
  ]

  # the following dependencies are dependencies of React native itself.
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'

  # your other libraries will follow here!
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
  pod 'Firebase/Core', '~> 5.15.0'
  pod 'Firebase/Auth', '~> 5.15.0'
  pod 'Firebase/Firestore', '~> 5.15.0'
  pod 'Firebase/Messaging', '~> 5.15.0'
  pod 'Firebase/Database', '~> 5.15.0'
  pod 'Firebase/Storage', '~> 5.15.0'
  pod 'RNGoogleSignin', :path => '../node_modules/react-native-google-signin'
  pod 'GoogleSignIn', '~> 4.4.0'
  pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler/ios'
  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
  pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
  #pod 'react-native-google-places', :path => '../node_modules/react-native-google-places' #there is no such .podspec file add manually
  pod 'GoogleMaps'
  pod 'GooglePlaces' 
  pod 'GooglePlacePicker'
  pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
  pod 'FBSDKCoreKit'
  pod 'FBSDKLoginKit'

end

# The following is needed to ensure the "archive" step works in XCode.
# It removes React from the Pods project, as it is already included in the main project.
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

install! 'cocoapods',
         :deterministic_uuids => false,
         :integrate_targets => false

我找不到解决方案的相关问题:

  

https://github.com/firebase/firebase-ios-sdk/issues/2177

     

https://github.com/firebase/firebase-ios-sdk/issues/2385

1 个答案:

答案 0 :(得分:1)

  

'''我一直在与firebase-ios-sdk团队一起做出响应   相信我们已经确定了问题,并且现在有解决方法。

     

问题:https://github.com/firebase/firebase-ios-sdk/issues/2604

     

解决方法:找到“ gRPCCertificates.bundle”文件。找到   其中的root.pem文件。将root.pem文件添加到ios应用程序下   项目导航器。确保检查其目标成员身份   您的应用目标。确保在构建阶段,“复制捆绑资源”为   您的应用目标为添加了“ root.pem”

     

清理构建文件夹可能不会受到伤害。构建并运行   您应该不再看到该错误。 (请注意,这不是代码。)'''

     

Blockquote   PS SO,所有这些都不像代码。