Swift Package with @objc cannot find interface declaration

I am using a Swift PM module and adding it to a brand new project. This project is Objective-C based, but I would like to use the module within a .swift file as I am working to migrate part of my project to Swift. The .swift file is called from the Objective-C app delegate.

When doing this method on a brand new project, it builds correctly.

However, when I add the module to my production app (has been in development for 10 years) in the same way, I get the following error in my MyApp-Swift.h file:

Cannot find interface declaration for 'MBNavigationViewController', superclass of 'CarPlayMapViewController'; did you mean 'UINavigationController'?

I have even created a stripped down version of my app with minimal files and it still does not build.

There must be some build setting or something else that allows the module to work in a brand new project (accessing the MyApp-Swift.h file that generates the Obj-C methods) but not in my older project?

Answered by zedsaid in 794995022

For those looking for a solution to this, I figured it out by accident.

**I was using a AppDelegate.mm file that needed to change that to AppDelegate.m instead. **

Accepted Answer

For those looking for a solution to this, I figured it out by accident.

**I was using a AppDelegate.mm file that needed to change that to AppDelegate.m instead. **

Swift Package with @objc cannot find interface declaration
 
 
Q