Cant find framework header when building application

Having issues with building a React-Native application that uses a wrapper library for a third-party framework.

The podspec of the library looks like:


package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
 s.name     = "react-native-garmin-connect"
 s.version   = "1.0.0"
 s.summary   = package["description"]
 s.description = <<-DESC
         react-native-garmin-connect
          DESC
 s.homepage   = "https://github.com/github_account/react-native-garmin-connect"
 # brief license entry:
 s.license   = "MIT"
 # optional - use expanded license entry instead:
 # s.license  = { :type => "MIT", :file => "LICENSE" }
 s.authors   = { "Your Name" => "yourname@email.com" }
 s.platforms  = { :ios => "9.0" }
 s.source    = { :git => "https://example@bitbucket.org/launchlab/react-native-garmin-companion-sdk.git", :tag => "v{s.version}" }

 s.source_files = "ios/*.{h,c,m,swift}"
 s.vendored_frameworks = "ios/companion.xcframework"
 s.requires_arc = true

 s.dependency "React"

end

And when I look at the Development Pods folder for the library, I can see the companion.xcframework in the Frameworks directory. It is not present in the Pods/frameworks however

The error I receive when I build the project, in buildtime for the react-native-garmin-connect library, is that the companion/companion.h file is not found, in the import statement in the pod header

#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
#import <companion/companion.h>

The project is using React-native library 0.61.5 to do the linking, and I've tried running

rm -rf ~/Library/Developer/Xcode/DerivedData/
rm -rf ~/Library/Caches/CocoaPods/
pod deintegrate
pod update

Which shows that Installing react-native-garmin-connect (1.0.0) & Auto-linking React Native modules for target Regenemm: react-native-garmin-connect

Any help would be appreciated, not very experienced with using pods &/or frameworks :'(

Answered by Cliffery in 704390022

Might have been a simple answer for this one here. Turns out there's a requirement of xCode and Cocoapods versions for using xcframeworks. To use .xcframework you must ensure your xCode version >= 12.2 and your Cocoapods version (pod --version) >= 1.10.1.

Found this nugget here, though I'm sure there are docs on the dev forum/site https://blog.embrace.io/xcode-12-and-xcframework/

Accepted Answer

Might have been a simple answer for this one here. Turns out there's a requirement of xCode and Cocoapods versions for using xcframeworks. To use .xcframework you must ensure your xCode version >= 12.2 and your Cocoapods version (pod --version) >= 1.10.1.

Found this nugget here, though I'm sure there are docs on the dev forum/site https://blog.embrace.io/xcode-12-and-xcframework/

Cant find framework header when building application
 
 
Q