21

I am having difficulty understanding this step on installing firebase Crashlytics in my app:

Xcode 10 only: Add your app's built Info.plist location to the Build Phase's Input Files field: $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

This what I have so far (please see picture), however, I am not getting any of the crash reports on Crashlytics. Am I putting the code in the wrong place? Where should I put it?
enter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267
marco
  • 656
  • 2
  • 6
  • 22
  • Mike from Fabric here. Please make sure you're using the most recent SDK release - 1.7.11 of Fabric and 3.10.8 that should improve this behavior. – Mike Bonnell Sep 28 '18 at 15:25
  • @droidBomb, regarding your edit, it's nice to capitalize, but it would be better to correct the spelling. – Cœur Oct 22 '18 at 06:27
  • 2
    does anyone know why there are parenthesis being used instead of curly braces? – aman Jul 18 '19 at 17:24

6 Answers6

22

Use

$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

instead of

$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

yeh
  • 1,496
  • 14
  • 35
  • do you know if there is anyway to navigate to this directory and to know what each of these variables are on my computer, for me to validate the file exists there ? (I'm asking because firebase is still not finding my Crashlytics as installed) – aman Jul 18 '19 at 20:13
  • I cant remember where I saw it today, but someone used echo to find infoplist_path – C. Skjerdal Jul 18 '19 at 21:12
  • 3
    why is it prefiled with $(SRCROOT) in xcode and even in the firebase docs if we don't need $(SRCROOT) ? – isJulian00 Jul 19 '19 at 18:51
4

Go into Build settings of the your target. Find "Debug Information Format". Set this from "DWARF" in both debug and release to "DWARF with dSYM File"

Ayush Goel
  • 1,103
  • 1
  • 7
  • 7
3

Please follow below steps to implement firebase crashlytics in to project

1) Setup Firebase account and create your project.

https://firebase.google.com/docs/crashlytics/?authuser=1

Must require this file: GoogleService-Info.plist

You can generate this file from Firebase

2) Install Firebase and Crashlytics using Podfile.

Podfile

3) Go to Project -> Build Phase -> Click on " + " sign

Build Phase

Add run script as per below image

Run Script

4) Import Firebase framework in AppDelegate file.

import Firebase

FirebaseApp.configure()
Fabric.sharedSDK().debug = true

// Put this method in your viewController
@IBAction func btnCrashClick(_ sender: Any) {
    Crashlytics.sharedInstance().crash()
}
Parth Patel
  • 915
  • 11
  • 33
2

Replace the round brackets with curly brackets like this

${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}

You can check if the path actually exists if you call echo $(BUILT_PRODUCTS_DIR) in the script phase. Using round brackets gave me following info in the Xcode build console "BUILT_PRODUCTS_DIR: command not found".

Replacing the round brackets with curly brackets will print the actuall path and therefore the script finally worked for me.

PatrickDotStar
  • 1,654
  • 1
  • 19
  • 20
0

Its xcode 10 or above only,

  1. First add the new run script phase, add

    $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

example screenshot below,

please check your new run script phase example 2. In the Project Navigator, right click on "Info.plist", and "Open as" → "Source Code", add the below code

<key>Fabric</key>
        <dict>
            <key>APIKey</key>
            <string><FABRIC-API-KEY></string>
            <key>Kits</key>
            <array>
                <dict>
                    <key>KitInfo</key>
                    <dict/>
                    <key>KitName</key>
                    <string>Crashlytics</string>
                </dict>
            </array>
        </dict>

Finally Run your xcode 10 or above, its working fine. hope its helpful

Iyyappan Ravi
  • 3,205
  • 2
  • 16
  • 30