简体   繁体   中英

Header 'RevenueCat-Swift.h' not found & Could not build Objective-C module 'RevenueCat'

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM