I integrated RevenueCat into an app written in Swift and SwiftUI. It worked all well until now.
All of the sudden Xcode throws these two errors when building the app:
Could not build Objective-C module ‘RevenueCat’
At the import RevenueCat statement
Header ‘RevenueCat-Swift.h’ not found
In a modul.modulemap
The Content of the modulemap is as followed.
framework module RevenueCat {
umbrella header "RevenueCat-umbrella.h"
export *
module * { export * }
}
module RevenueCat.Swift {
header "RevenueCat-Swift.h"
requires objc
}
The weird thing is, that after rebuilding the app once or twice, the errors disappear.
However, if I try to archive the app, they pop up every time and prevent Xcode from archiving the Build.
I updated to the lates Xcode version some days ago, beside that there’s nothing special that could point to the start of the problem.
Any Ideas on that?
2
Answers
I solved it.
Somehow my pods framework ended as a target in my build scheme… 😨 I don’t know when that happened but it was not intended and removing it solved the issue.
I would recommend installing using the Swift Package Manager. I had a lot of Swift issues with our Objective C Project, especially with their Example Swift app. Ultimately went with Glassfy which is much easier to setup and use. Also, Glassfy seems to be more Objective C friendly…