iOS TwitterKit fails app builds - won't code sign

ios
twitterkit

#1

Having trouble figure this out.

I’ve tried integrating Twitter support into my app using Fabric, following the instructions on the twitter developer site.

I downloaded the Fabric OSX app and told it to install the libraries into my project. It installed Fabric.framework, TwitterKit.framework and TwitterCore.framework. I then added a script phase as requested to by Fabric (although I’m not sure what it does).

But when I attempt to build the app, it fails code signing TwitterKit.framework, saying

.../TwitterKit.framework: bundle format unrecognized, invalid, or unsuitable

Fabric had installed TwitterKit version 2.7.0. As part of trying to work out what to do I downloaded v2.5.0 and tried that with the same results.

If I turn off code signing for TwitterKit.frame I get this: Bundle at path …/TestApp.app/Frameworks/TwitterCore.framework has missing or invalid CFBundleExecutable in its Info.plist

I’m pretty much stuck now. I can’t find anyone on the net whose had this problem and I don’t know why just this one framework won’t code sign.

Any ideas what to do next?


#2

Hey @d4rkf1br3,

When you mention installing the frameworks, are you linking in the frameworks or just copying them in?

-Mike


#3

Hi Thanks for replying.Thanks for the reply. I copied the frameworks in. Below I’ve copied the reply I gave on your other response which details the problems I’ve found with the frameworks and how I’ve got around them. However Twitter is still broken. It will now compile and run the app without crashing. But the moment I try to start Fabric with Fabric.with(Twitter.self) it crashes out saying it cannot find the application icon.

I presume this is an icon in the Twitter bundle. I’ve tried adding the bundle to my framework, to the app, both at the root of the app and in the resources directory. Nothing works.

Getting really un-impressed with this framework.

From https://twittercommunity.com/t/downloading-the-latest-crashlytics-ios-framework-without-the-fabric-mac-app-possible/74539

The process you linked to is exactly what I did, except with Twitter instead of Crashlytics.

I’ve now figured out the problems and in the process of working out a final solution. I located two problems:

  1. The TwitterKit framework contains an embedded resources bundle. The presence of this bundle causes code-signing to fail when the framework is added to a copy files phases with a destination of Frameworks and with Code sign on Copy turned on. So far I’ve established that removing the embedded bundles from the framework resolves this problem.

  2. The TwitterCore framework’s Info.plist is missing the Executable File key which causes the app to crash when attempting to run with this framework included. Manually adding this missing key fixes the problem.