For you easiness, I have draft those Podfile + patch commands (so you can just copy-paste) to handle the SecurePDFViewer + Yoga issues together.
1. Podfile (updated)
Replace your current post_install with this:
post_install do |installer|
-â Fix Yoga header issue ----
private_yoga_headers = â#{installer.sandbox.root}/Headers/Private/Yogaâpublic_yoga_headers = â#{installer.sandbox.root}/Headers/Public/Yogaâ
FileUtils.mkdir_p(public_yoga_headers) unless Dir.exist?(public_yoga_headers)system(ârsync -a #{private_yoga_headers}/ #{public_yoga_headers}â)
-â React Native default post-install ----
react_native_post_install(installer,config[:reactNativePath],:mac_catalyst_enabled => false,)
-â Patch SecurePDFViewer search paths ----
installer.pods_project.targets.each do |target|if target.name == âsecure-pdf-viewerâtarget.build_configurations.each do |config|config.build_settings[âHEADER_SEARCH_PATHSâ] ||= [â$(inherited)â]config.build_settings[âHEADER_SEARCH_PATHSâ] << â${PODS_ROOT}/Headers/Private/React-Fabricâendendendend
2. SecurePDFViewerManager.mm patch
Inside libraries/@mattermost/secure-pdf-viewer/ios/SecurePDFViewerManager.mmreplace this import:#import <react/renderer/components/RNSecurePdfViewerSpec/ComponentDescriptors.h>
with#import <react/renderer/components/view/ComponentDescriptors.h>
(Fabric headers moved in RN 0.75+, this points to the correct location.)
3. Disable Duplicate Interface Generation (Workaround)
If you still hit the Duplicate interface for SecurePdfViewerComponentView error,add this to the top of SecurePDFViewerManager.mm
:#define RCT_NEW_ARCH_ENABLED 0
That forces this module to build in the old architecture mode, avoiding duplicate Fabric definitions.
4. Clean + Reinstall Commands
Run these in project root:
# Clean everything
watchman watch-del-all
rm -rf node_modules ios/Pods ios/build
npm install
# Install pods natively on M4 (no x86_64!)
cd ios && pod install && cd ..
# Clean Xcode cache
xed ios
# Then in Xcode: Product > Clean Build Folder
With this setup:
- Yoga headers are always copied into
Public automatically.
- SecurePDFViewer gets the right header search paths.
- Fabric duplication is disabled until the library updates.
- No more
arch -x86_64 hacks (all ARM64).