Strange swift bridging header import error.

Answered

I have a project written in Objective c, but has a library written in Swift, linked with Cocoapods. In Xcode it all works and i just submitted to App Store.

I have a viewcontroller that uses classes in my swift module. In the top of the .m-file i import the module like this:

@import MyLibrary;

 

However, now when i open it up in AppCode, there are tons of strange errors. First, it wants to add an import to my MyLibrary-Swift bridging header that exists in som/DerivedData/MyApp-hbvequuinwqzwrdpvkqeyxpzzovm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/MyLibrary.build/DerivedSources/-catalogue.

Also, i have a "commons"-project, also a local cocoa pod. All #import-rows related to classes in that library are red now, this was no problem before i added the @import-command.

 

This feels like black magic to me, i have no idea how to proceed, especially since it works fine in xcode.

1 comment
Comment actions Permalink

Hi Mathias. Could please share the name of the Cocoapod that you're using, as well as the versions of AppCode and Xcode which you're using, so we could try to reproduce the problem? Alternatively, sharing a sample project with the same structure would greatly help us to reproduce the problem.

Also, could you please try to build your project in AppCode and see if it helps? Could be that certain files in DerivedData are generated only upon a build.

0

Please sign in to leave a comment.