[iOS] FaroReactNative-Swift.h not found with use_frameworks! :linkage => :static
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
- Domain
- build-system, mobile-dev
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from grafana/faro-react-native-sdk
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
grafana/faro-react-native-sdk#188 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
grafana/faro-react-native-sdk#144 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
grafana/faro-react-native-sdk#52 · 1 comment ·
-
github-actions
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in grafana/faro-react-native-sdk
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100