繁体   English   中英

Firebase崩溃报告无法在iOS实际设备上运行

[英]Firebase Crash Reporting not working on iOS real devices

我在iOS上遇到了Firebase崩溃报告的一些问题。 当我在模拟器上运行我的测试应用程序时,它工作得很好。 但是当我在真实设备上运行它时,没有任何事情发生。 这是我的示例代码:

import UIKit
import FirebaseCrash

class ViewController: UIViewController {

@IBOutlet weak var btn: UIButton!
override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    btn.addTarget(self, action: #selector(ViewController.btnClicked), forControlEvents: UIControlEvents.TouchUpInside)
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

func btnClicked() {
    FIRCrashMessage("Cause Crash button clicked")
    fatalError()
}

}

有什么建议可以解决我的问题吗? 谢谢。

脚步

  1. 我将应用程序从Xcode安装到真实设备。

  2. 我按“命令+”停止应用程序。

  3. 我从真实设备启动应用程序并使其崩溃。
  4. 我重新启动了应用程序。
  • 你加FIRApp.configure()didFinishLaunchingWithOptions你的方法appDelegate文件?
  • 当你重新启动应用程序(注释错误)时,你会在控制台中看到像Crash message uploaded

也:

重置您的OAuth凭据,运行以下命令:

rm $HOME/Library/Preferences/com.google.SymbolUpload*

创建新的服务帐户并确保其具有编辑权限将脚本修改为以下格式:

   # Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
   GOOGLE_APP_ID=1:my:app:id

   # Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
   "${PODS_ROOT}"/FirebaseCrash/upload-sym "/Path/To/ServiceAccount.json"

请确保您的应用ID和json文件路径正确无误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM