Skip to content

Static frameworks: HEADER_SEARCH_PATHS in podspec missing cpp/api, cpp/skia, cpp/jsi, cpp/rnskia, cpp/utils → 'third_party/base64.h' file not found at compile #3839

@Jawish-a

Description

@Jawish-a

Summary

When building an iOS app that consumes @shopify/react-native-skia with use_frameworks! :linkage => :static (or Expo's useFrameworks: 'static'), compilation fails on missing headers like:

'third_party/base64.h' file not found

inside node_modules/@shopify/react-native-skia/cpp/api/third_party/base64.cpp.

The header exists at cpp/api/third_party/base64.h, but the HEADER_SEARCH_PATHS setting in react-native-skia.podspec does not include cpp/api. The recursive "$(PODS_TARGET_SRCROOT)/cpp/"/** glob does not propagate when the project uses static frameworks, so individual sub-paths must be listed explicitly.

Affected versions

I've reproduced this on 2.4.18 through 2.6.2, and the current main branch ships the same incomplete line.

"HEADER_SEARCH_PATHS" => '"$(PODS_TARGET_SRCROOT)/cpp/"/** "$(PODS_TARGET_SRCROOT)/cpp" "$(PODS_TARGET_SRCROOT)/cpp/jsi2" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu/api" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu/api/descriptors" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu/async" "$(PODS_TARGET_SRCROOT)/cpp/dawn/include"'

The following directories exist in 2.6.2 and contain headers referenced by sibling .cpp files, but are NOT on the explicit search path:

  • cpp/api
  • cpp/skia
  • cpp/jsi
  • cpp/rnskia
  • cpp/utils

Environment

  • Expo SDK 55 (RN 0.83.6, New Architecture)
  • expo-build-properties with useFrameworks: 'static'
  • iOS 17/18 SDKs
  • Apple Silicon (M-series) Mac
  • Reproduced via both expo prebuild && pod install && xcodebuild and EAS Build

Proposed fix

Add the five missing explicit paths to the existing line:

```diff
-"HEADER_SEARCH_PATHS" => '"$(PODS_TARGET_SRCROOT)/cpp/"/** "$(PODS_TARGET_SRCROOT)/cpp" "$(PODS_TARGET_SRCROOT)/cpp/jsi2" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu/api" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu/api/descriptors" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu/async" "$(PODS_TARGET_SRCROOT)/cpp/dawn/include"'
+"HEADER_SEARCH_PATHS" => '"$(PODS_TARGET_SRCROOT)/cpp/"/** "$(PODS_TARGET_SRCROOT)/cpp" "$(PODS_TARGET_SRCROOT)/cpp/api" "$(PODS_TARGET_SRCROOT)/cpp/skia" "$(PODS_TARGET_SRCROOT)/cpp/jsi" "$(PODS_TARGET_SRCROOT)/cpp/jsi2" "$(PODS_TARGET_SRCROOT)/cpp/rnskia" "$(PODS_TARGET_SRCROOT)/cpp/utils" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu/api" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu/api/descriptors" "$(PODS_TARGET_SRCROOT)/cpp/rnwgpu/async" "$(PODS_TARGET_SRCROOT)/cpp/dawn/include"'
```

These are the same paths I'm currently maintaining via patch-package in my project (regenerated for every Skia version bump). Happy to submit a PR if helpful.

Current workaround

patch-package against the podspec, regenerated per Skia version. Tedious but works.

Related

Reference for users hitting `SkData.h not found` and similar (#652) — same class of static-frameworks header-resolution defect, different missing path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions