Hello,
I am currently working on a React Native project, which I am encountering an issue with during the iOS build process.
Project Overview
My app is a cross-platform mobile application built using React Native. The project is structured to include both iOS and Android platforms, with the main application code residing at the root level of the project directory. The iOS-specific files are located in the ios directory, while the Android-specific files are in the android directory.
Project Structure
The project structure is as follows:
app
├── android
├── ios
├── app.json
├── App.tsx
├── assets
├── babel.config.js
├── eas.json
├── env.d.ts
├── index.js
├── metro.config.js
├── modules
│ └── esl
│ ├── android
│ ├── ios
│ │ ├── Esl.podspec
│ │ ├── EslModule.swift
│ │ └── Frameworks
│ │ └── MTESLTagV3Kit.framework
│ │ ├── Headers
│ │ │ ├── MTBroadcastHandler.h
│ │ │ ├── MTBrushManager.h
│ │ │ ├── MTCentralManager.h
│ │ │ └── (other headers...)
├── node_modules
└── package.json
Native Module: ESL
The ESL module is a native module bundled through Expo Modules Core to be used in the React Native application. The ESL native code relies on an external library/framework, MTESLTagV3Kit.framework, which I need to import manually into the project. This framework includes several header files, including MTBroadcastHandler.h
Issue Description
I am encountering the following error during the iOS build process, particularly when attempting to archive the project using eas build --profile production --platform ios:
MTBroadcastHandler.h' file not found
This error appears in the Esl-umbrella.h file, which is part of the MTESLTagV3Kit.framework located in modules/esl/ios/Frameworks/MTESLTagV3Kit.framework/Headers.
(The same error occurs for all the .h files that are in this directory)
Steps Taken to Resolve the Issue
Verified File Existence: Confirmed that MTBroadcastHandler.h is present in the correct directory.
Header Search Paths: Added the following path to the HEADER_SEARCH_PATHS in both Debug and Release configurations in Xcode:
"$(SRCROOT)/../modules/esl/ios/Frameworks/MTESLTagV3Kit.framework/Headers"
Podfile Modifications: Updated the Podfile to include the header search path during the pod installation process:
platform :ios, '13.0'
target 'HBScan' do
use_frameworks!
pod 'SomePod'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) $(SRCROOT)/Headers/**'
config.build_settings['HEADER_SEARCH_PATHS'] << '$(SRCROOT)/../modules/esl/ios/Frameworks/MTESLTagV3Kit.framework/Headers'
end
end
puts 'Post Install Script - Header Search Paths'
system("xcodebuild -showBuildSettings | grep HEADER_SEARCH_PATHS")
end
end
Framework Headers: Ensured that MTBroadcastHandler.h and other headers are included in the Xcode project and marked as public:
Verified in the Build Phases -> Headers section that MTBroadcastHandler.h is listed under Public.
Cleaned and Rebuilt Project: Performed Product -> Clean Build Folder in Xcode and then attempted to rebuild the project.
Local Development Success
When running the project locally using npx expo run:ios --device,
the application builds and runs perfectly on my device. This suggests that the local development environment is correctly configured.
Persistent Issue During EAS Build
Despite these efforts, the build process fails with the 'MTBroadcastHandler.h' file not found
error during the archive phase when using eas build --profile production --platform ios.
I am seeking guidance on what might be causing this issue and how to resolve it.
I appreciate any assistance or insights you can provide. Thank you for your time and support.