Xcode tries to compile Objective-C libraries like Swift

I have an iOS Swift Project on Xcode.

I worked on it for a long time, using external Objective-C libraries for my Swift code without any problems.

Suddenly after Xcode received the update (I think), I try to run my project and apparently try to compile the external Objective-C as Swift, so of course it fails.

I am attaching a screenshot with errors:

enter image description here

And this is my bridge title:

#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?

+5
source share
2 answers

This did not work because I am using Parse as my first Cocoapod dependency. So I deleted it from my subfile and set it using the drag and drop style.

Then, right after that, the final solution to my problem with working with Cocoapods dependencies was to uninstall everything (except Parse), update Cocoapods to the latest version, reinstall everything (while Xcode is closed).

PD: The solution above works fine when using drag-and-drop installed libraries.

+1
source

Hmm .. I had the same problem before.

After trying to clean and delete the derived data, I fixed it by deleting the old obj-c libraries and re-adding them to my project. There may be an established goal to tell ARC to read objective c, but I never found it.

My Obj-c libraries somehow lost their targeted membership and thought it was fast.

Commit your changes. Save the bridge title and delete the library and add the File - New - Target - library again (make sure Obj-C is installed as the language), and then add the class files to the directory. He must compile ...

+1
source

All Articles