Ios – Build failed ‘React/RCTBridgeModule.h’ file not found

cocoapodsiosreact-nativexcode

I spent my day trying to fix my problem, I tried every solution I found in other SO posts but unfortunately I can't figure out how to solve my problem.

I try to integrate TouchID inside my react-native project. I downloaded a npm package called "react-native-touch-id" (sounds perfects !). I followed installation guide and I manually linked library to my project.

But when I try to run application I get the following error :

main problem image
enter image description here

I tried to clean my project :

  • rm -rf node_modules
  • yarn cache clean && yarn install
  • rm -rf ios/Pods/ && pod install

In xCode I even clean the build folder.

About my versions :

  • RN : 0.57.4
  • xCode : 10.1
  • react-native-touch-id : 4.3.0

Here's my Podfile :

def available_pods
  pod 'TouchID', :path => "../node_modules/react-native-touch-id"
end
target 'App' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  available_pods
end

I added the .xcodeproj of react-native-touch-id package inside my project's libraries directory and in Build Phases I linked it.

enter image description here
enter image description here

But I still getting the same error again and again … I don't understand why … If someone have an idea some help would be really appreciated 🙂

Best Answer

It appeared the problem was the Podfile. It seems that Podfile use its own Podspec which caused troubles. So I simply delete the TouchId pod declaration from my Podfile, clean and re-install my pods.

Then, I manually linked the library to my xcode workspace. To do that, under your project name, Right Click on Libraries directory => Add files to "your project name" => Add the xcodeproj of the npm's package located inside your node_modules directory.

After that, in your project Build Phases under the Link Binary with Libraries you have to add the npm's package static library (example libTouchID.a in my case).

To be sure you can clean your project and try to rebuild, it should work now.

For information, I kept all of my softwares version I mentionned above.

Related Topic