我正在开发一个反应本机应用程序,我已经设法在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
'''我一直在与firebase-ios-sdk船员相对应 相信我们已经察觉了这个问题,并且目前有解决方法。
问题:https://github.com/firebase/firebase-ios-sdk/issues/2604
解决方法:找到'grpccertificates.bundle'文件。找到 root.pem文件中。将root.pem文件添加到您的iOS应用 项目导航器。确保检查其目标成员资格 您的应用程序目标。确保在构建阶段,"复制捆绑资源" 您添加了" root.pem"的应用程序目标
可能会清洁构建文件夹不会有任何伤害。构建和运行 您不应该再看到错误。(ps这不是代码。)''''
blockquote ps因此,这些都不类似于代码。
i 100%解决问题
UPDATE 您的Pods
然后确保 delete 来自电话/模拟器的应用
和运行该应用程序可以正常工作