Maxwell Maxwell - 1 month ago 15
iOS Question

iOS: Crashlytics Crashing on Init

In my AppDelegate, I call

[Fabric with:@[CrashlyticsKit]];


and everything works fine. Now I pulled my code onto another machine, and the same line gives me the following error:

*** Terminating app due to uncaught exception 'FabricException', reason: '[Fabric] Value of Info.plist key "Fabric" must be a NSDictionary.'


I'm not aware of any additions in my project's plist. Any ideas what this error may be referring to and how to fix it?

Answer

Fabric automatically inserts of hunk of text into your application's plist when you install it. These are essential and Fabric throws an exception on initialisation if they're not present.

Unfortunately it doesn't actually tell you it does this, so we ran into this crash on a project where the plist was automatically generated by a tool - which overwrote what Fabric had added.

For reference, this is what the Fabric part of the plist looks like in the current version (not sure where the version number is, but the latest version as of 15th June 2015).

<key>Fabric</key>
<dict>
        <key>APIKey</key>
        <string>your-api-key</string>
        <key>Kits</key>
        <array>
                <dict>
                        <key>KitInfo</key>
                        <dict/>
                        <key>KitName</key>
                        <string>Crashlytics</string>
                </dict>
        </array>
</dict>
Comments