Twitter integration in iOS app

2019-09-10 11:46发布

问题:

In my ios app I'm trying to integrate twitter with fabric and i followed all the docs provided by fabric https://docs.fabric.io/ios I have a problem when i build my app then some error

1.TwitterCore.framework/Headers/TwitterCore.h:20:9: 'Cocoa/Cocoa.h' file not found

2.TwitterKit.framework/Headers/TwitterKit.h:12:9: Could not build module 'TwitterCore'

3.AppDelegate.m:14:9: Could not build module 'TwitterKit'

so i am unable to build app.

回答1:

I had the exact same issue, the Cocoa/Cocoa.h header is for OS X, since we are doing iOS, I removed this header. Open your TwitterCore.h

This snippet

#if IS_UIKIT_AVAILABLE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif

Becomes

#if IS_UIKIT_AVAILABLE
#import <UIKit/UIKit.h>
#endif

And now my project builds just fine.