ios - React Native Firebase 错误线程 1 SIGABRT - iOS

标签 ios firebase react-native sigabrt react-native-firebase

问题

完成 react-native-firebase 的教程后,我的应用程序在成功构建后挂起。我在 Xcode 中得到的错误是:Thread 1: signal SIGABRT .我从其他问题上了解到这与连接有关,但我不知道为什么会出现此错误。

这是我的第一个 React Native 项目,也是第一次使用 Xcode。

我做了什么

  1. 我添加了 react-native-firebasefirebase .
  2. react-native link react-native-firebase .
  3. 通过将 GoogleService-Info.plist 拖到 Xcode 编辑器中将其添加到项目中。
  4. 停止所有 Xcode 任务并退出 Xcode。
  5. 做了 pod init .
  6. 将 podfile 调整为以下内容:

    # Uncomment the next line to define a global platform for your project
    platform :ios, '9.0'
    
    target 'Enso' do
    # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
    # use_frameworks!
    
      # Pods for Enso
        pod 'Firebase/Core'
    
    end
    
  7. 做了 pod install
  8. 打开 xcworkspace 文件
  9. 添加了 #import <Firebase.h>[FIRApp configure];AppDelegate.m
  10. 清理项目
  11. 运行项目
  12. 项目构建成功,但应用程序一直卡在白屏上,并显示应用程序名称和“Powered by React Native”。
  13. 大约 10 秒后,Xcode 编辑器将显示以下内容:Image with error in Xcode

更多信息

我有这些Linked Frameworks and Libraries :

  • libRNSVG.a
  • libRNBackgroundTimer.a
  • libRNFirebase.a
  • libART.a
  • libRCTBlob.a
  • libReact.a
  • libRCTAnimation.a
  • libRCTActionSheet.a
  • libRCTGeolocation.a
  • libRCTImage.a
  • libRCTLinking.a
  • libRCTNetwork.a
  • libRCTSettings.a
  • libRCTText.a
  • libRCTVibration.a
  • libRCTWebSocket.a
  • libPos-Enso.a

我的 Header Search Paths 里有这个:

  • $(继承)
  • $(SRCROOT)/../node_modules/react-native-background-timer/ios
  • $(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase
  • $(SRCROOT)/../node_modules/react-native-svg/ios
  • $(SRCROOT)/../ios/Pod
  • $(SRCROOT)/../node_modules/react-native/React

最佳答案

看起来 GoogleAppMeasurement 被导入为版本 5.3.0 的依赖项。

像下面这样对 Podfile 的简单添加为我解决了这个问题。

# Required by RNFirebase
pod 'Firebase/Core', '~> 5.9.0'
pod 'GoogleAppMeasurement', '~> 5.2.0'

如图所示

关于ios - React Native Firebase 错误线程 1 SIGABRT - iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46846166/

相关文章:

ios - com.apple.InterfaceBuilder 错误 -1。 Storyboard 无法打开

firebase - 我可以在 firebase 测试云设备上配置 VPN

react-native - 使用react-native 0.43.3 babel-plugin-root-import错误路径

react-native - null 不是 Cameraroll 中的对象(评估 '_nativeInterface.default.getPhotos')

ios - 如何测试使用 Jest 导入自定义 native 模块的 React Native 组件?

ios - 如何检索评论/帖子的键

ios - 无法通过 CocoaPods 安装 pod (Mixpanel) - 编译失败(找不到文件) - 桥接头问题?

iphone - 推送通知未出现在通知托盘中

android - Firebase 消息传递 - 什么 "content_available": true

ios - UILabel 文本编辑后 UITableViewCell 重复