I have a iOS Swift Project on Xcode.
I've been working on it for a long while using external Objective-C libraries on my Swift code with no problem.
Suddenly, after Xcode got updated (I guess), I try to run my project and apparently it's trying to compile de external Objective-C as Swift, so, of course, it fails.
I attach an screenshot with the errors:
And this is my Bridging Header:
#define degreesToRadian(x) (M_PI * (x) / 180.0)
#import <Parse/Parse.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <Bolts/Bolts.h>
//#import <Facebook-iOS-SDK/FacebookSDK/FacebookSDK.h>
#import <ParseFacebookUtils/PFFacebookUtils.h>
#import <Bugsnag.h>
#import <M13Checkbox.h>
#ifndef VideoCloudBasicPlayer_VideoCloudBasicPlayer_Bridging_Header_h
#define VideoCloudBasicPlayer_VideoCloudBasicPlayer_Bridging_Header_h
#import "BCOVPlayerSDK.h"
#endif
Any ideas?
Hmm.. I had the same issue before.
After trying to clean and remove derived data, I fixed it by removing the old obj-c libraries and re-adding them to my project. There may be a setting in target to tell the ARC to read objective c, but I never found it.
My Obj-c libraries somehow lost their target membership and thought it was swift.
Commit your changes. Save your bridging header and remove the library and re-add the library, File - New - Target - (make sure Obj-C is set as language), then add your class files to the directory. It should compile...
It didn't work before due to I'm using Parse as my first Cocoapod dependency. So I erased it from my Podfile and installed it by drag and drop style.
Then, just after that my final solution to my issue when working with Cocoapods dependencies was to delete everything (except Parse), update the Cocoapods to the latest version, reinstall everything (while Xcode is closed).
PD: The solution above works perfectly when using Drag-and-drop installed libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With