"Use of undeclared type" error for Custom Framework ONLY in xCode 11.4

I am running into an issue with the newest version of xCode, 11.4 with the core application in Swift. I have a custom Dynamic Framwork that we have been building for a few years now. The majority of the code is in Objective C but we are slowly building new pieces in Swift. Since our Framework cannot rely on Bridging Headers, we need to utilize our module.modulemap file:

module Module {

// import your private headers here

header "../Views/Base/CallToActionButton.h"

export *

}


You can see how/why things are done in more details here: https://www.bignerdranch.com/blog/it-looks-like-youre-still-trying-to-use-a-framework/


This functionality WORKS! Implementing module.modulmap worked perfectly and our Framework was able to be embedded into other Swift applications. Up to xCode 11.3.1, this worked perfectly. Now, since the release of xCode 11.4, the core Swift application embedding our SDK will NOT compile giving an "Use of undeclared type" error in the x86_64-apple-ios-simulator.swiftinterface file. The swiftinterface file is throwing that error on this line of code calling CallToActionButton.


@objc @objcMembers public class UITimer : ObjectiveC.NSObject {

@objc public static func setTimerFor(for button: CallToActionButton, with data: Foundation.NSDictionary) -----> Use of undeclared type 'CallToActionButton'

@objc deinit

}


This swiftinterface file is an autogengerated file so there's not much I can do to change that...is there? This happens for device or simulator in the appropriate swiftinterface file. If I go back to xCode 11.3.1 but still have the 11.4 developer tools selected, it compiles. But 11.4 will NOT compile. What could be the reason for this? The Framework is installed utilizing Cocoapods and the exact same SDK works for the older xCodes but NOT the newest.


Anyone have any thoughts? Clearly something changed between these xCodes but my files haven't changed one bit. HELP!!!

Replies

Customizing module maps isn't supported by Xcode, and as you've discovered, fragile. Please see this other thread for some additional background.