簡體   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