简体   繁体   中英

Firebase Crash Reporting not working on iOS real devices

I got some problems with Firebase Crash Report on iOS. When I run my testing app on the simulator, it works pretty fine. But when I run it on a real device, nothing happen. Here is my sample code:

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()
}

}

Any suggestion to fix my problem? Thank you.

Steps

  1. I install app from Xcode to a real device.

  2. I stop the app by press "command + ."

  3. I launch app from the real device and make it crash.
  4. I relaunch the app.
  • Did you add FIRApp.configure() on didFinishLaunchingWithOptions method of your appDelegate file?
  • When you relaunch the app(with the error commented) you see in console a message like Crash message uploaded ?

also:

reset your OAuth credentials, run below command:

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

create new service account and make sure it has editor permission Revise your script into below format:

   # 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"

Please make sure your app id and json file path are correct.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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