0

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?

wildcard
  • 896
  • 6
  • 16
  • I've had this happen too and think it's probably just an Xcode bug. As long as you can run the app and the errors disappear I would ignore it for now. As far as archiving are you running it on the "Any iOS Device" device option? It won't work if not. – Echizzle Jun 22 '22 at 21:00
  • Yes, I'm running it on the "Any iOS Device", it worked all well for the last couple of Weeks before the bug or whatever it is entered the room. – wildcard Jun 22 '22 at 22:46

2 Answers2

0

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.

screenshot

wildcard
  • 896
  • 6
  • 16
0

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...

John
  • 538
  • 4
  • 18