[iOS] FaroReactNative-Swift.h not found with use_frameworks! :linkage => :static

Open Beginner friendly
#135 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
objective-c, react-native, swift

Research direction

Start in FaroReactNativeModule.mm and inspect how the generated Swift compatibility header is imported. Verify the framework-qualified import against the CocoaPods static-framework configuration described in the issue, then build the iOS application with use_frameworks! :linkage => :static to confirm the missing-header error is resolved.

Written by the indexing model from the issue text.

Description

@grafana/faro-react-native@1.3.1 fails to compile on iOS when the application uses CocoaPods static frameworks:

use_frameworks! :linkage => :static

The build fails in FaroReactNativeModule.mm:

FaroReactNativeModule.mm:3:9: fatal error:
'FaroReactNative-Swift.h' file not found

#import "FaroReactNative-Swift.h"
        ^~~~~~~~~~~~~~~~~~~~~~~~~

Xcode successfully generates the Swift compatibility header and places it in FaroReactNative.framework/Headers, but the unqualified quoted import does not resolve it when Faro is built as a framework.
Changing the import to the framework-qualified form fixes the build:

#import <FaroReactNative/FaroReactNative-Swift.h>
Environment
  • @grafana/faro-react-native: 1.3.1
  • React Native: 0.85.3
  • Expo: 56.0.5
  • Xcode: 26.3 (17C529)
  • CocoaPods: 1.16.2
  • iOS deployment target: 16.4
  • Framework linkage: static
Verified workaround
Applying this patch fixes the build:
 #import "FaroReactNativeModule.h"
 #import <React/RCTBridgeModule.h>
-#import "FaroReactNative-Swift.h"
+#import <FaroReactNative/FaroReactNative-Swift.h>

Maybe it should be smth like

#if __has_include(<FaroReactNative/FaroReactNative-Swift.h>)
#import <FaroReactNative/FaroReactNative-Swift.h>
#else
#import "FaroReactNative-Swift.h"
#endif
Dominant language
TypeScript
Stars
9
Forks
4
Avg merge
1d 18h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from grafana/faro-react-native-sdk

All issues in grafana/faro-react-native-sdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.