2016-06-30 77 views
1

我在iOS上遇到了一些Firebase崩潰報告問題。當我在模擬器上運行我的測試應用程序時,它工作得很好。但是當我在真實設備上運行它時,什麼都沒有發生。這裏是我的示例代碼:Firebase崩潰報告不適用於iOS真實設備

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. 我按「command +」停止應用程序。

  3. 我從真實設備啓動應用程序並使其崩潰。
  4. 我重新啓動應用程序。
+0

我有同樣的問題,看看我的解決方案:[ANSWER LINK](http://stackoverflow.com/questions/40160230/firebase-crashes-unreadable) – Eduardo

回答

0
  • 你有沒有在你的appDelegate文件didFinishLaunchingWithOptions 方法添加FIRApp.configure()
  • 當您重新啓動應用程序(錯誤已評論)時,您在 控制檯中看到一條消息,如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文件路徑正確無誤。