John Russel Usi John Russel Usi - 9 days ago 8
Objective-C Question

App crash on using Fabric and TwitterKit

I've got this line of code on my application didFinishLaunchingWithOptions delegate method and it causes a crash saying:

'[Fabric] Value of Info.plist key "Fabric" must be a NSDictionary.'

Anyone can help me with this one?

Here's the code that causing the crash:

[[Twitter sharedInstance] startWithConsumerKey:@"consumer_key" consumerSecret:@"secret_key"];
[Fabric with:@[[Twitter sharedInstance]]];

Answer

Alex from Fabric here. To use different Twitter API keys or API keys generated on apps.twitter.com, you're declaring it correctly in your code above. It sounds like you may not have fully onboarded your app through the Fabric app, and required entries, like the Fabric APIKey, are missing from your info.plist.

Some more info on the Fabric Mac App and info.plist:

When you onboard an kit through the Mac App, a Fabric Dictionary entry is injected into your info.plist. Under the Fabric parent, there will be two children entries: APIKey and Kits.

enter image description here

Your Fabric API key, if it's not injected for some reason (it should be added automatically if you're using the Fabric app) or you want to manually change it, can be found by visiting https://fabric.io/settings/organizations, clicking your organization and clicking "API Key" below the organization title.

The Kits array contains an Item X for each Fabric kit you've included. If you've included Twitter Kit, the automatically provisioned consumerKey and consumerSecret are listed under KitInfo.