WatermelonDB: React Native iOS build failed because "'simdjson.h' file not found"

I’m not sure what’s going on. My RN version is 0.64.2, watermelondb version is 0.23.0-9

Screen Shot 2021-06-24 at 8 52 06 AM

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Hello guys,

This is what’s worked for me:

  1. Go to node_modules/@nozbe/simdjson/src

    • Copy those 2 files “simdjson.cpp” and “simdjson.h”

Captura de Tela 2021-12-02 às 00.41.08.png

  1. Go to node_modules/@nozbe/watermelondb/native/shared

    • Paste the files that you copied above “simdjson.cpp” and “simdjson.h”

Captura de Tela 2021-12-02 às 00.39.50.png

  1. Execute the comand yarn run ios , for me worked.

Make sure that you edited your podfile and write the 2 lines below:

    pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => true
    pod 'simdjson', path: '../node_modules/@nozbe/simdjson'

_Font: https://nozbe.github.io/WatermelonDB/Installation.html_

Some erros shows up, and this is how I fix:

  • In the first time, I got a message (fatal error: malformed or corrupted AST file…), with this, I have to go in the /Users/YOURUSERNAME/Library/Developer/Xcode/DerivedData and clean all the files in this folder before a try to make a new compilation.

  • To make sure that everything will works well, I deleted my folder Pods inside tha “ios” folder, and after I execute the command pod install to build this folder again. (Make sure you have the backup)

  • I deleted my folder node_modules to and download again with the command yarn install.

I hope this helps someone, bye bye 😉

Hello guys,

This is what’s worked for me:

  1. Go to node_modules/@nozbe/simdjson/src

    • Copy those 2 files “simdjson.cpp” and “simdjson.h”

Captura de Tela 2021-12-02 às 00.41.08.png

  1. Go to node_modules/@nozbe/watermelondb/native/shared

    • Paste the files that you copied above “simdjson.cpp” and “simdjson.h”

Captura de Tela 2021-12-02 às 00.39.50.png

  1. Execute the comand yarn run ios , for me worked.

Make sure that you edited your podfile and write the 2 lines below:

    pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => true
    pod 'simdjson', path: '../node_modules/@nozbe/simdjson'

_Font: https://nozbe.github.io/WatermelonDB/Installation.html_

Some erros shows up, and this is how I fix:

  • In the first time, I got a message (fatal error: malformed or corrupted AST file…), with this, I have to go in the /Users/YOURUSERNAME/Library/Developer/Xcode/DerivedData and clean all the files in this folder before a try to make a new compilation.
  • To make sure that everything will works well, I deleted my folder Pods inside tha “ios” folder, and after I execute the command pod install to build this folder again. (Make sure you have the backup)
  • I deleted my folder node_modules to and download again with the command yarn install.

I hope this helps someone, bye bye 😉

Hi @jamesjlv thanks a lot by the solution. I have added a little command at xcode that did the same that you did.

Captura de Tela 2022-10-19 às 10 45 59

For those looking to copy pasta the script in the above screenshot:

cp "${PROJECT_DIR}/../node_modules/@nozbe/simdjson/src/simdjson.cpp" "${PROJECT_DIR}/../node_modules/@nozbe/watermelondb/native/shared/simdjson.cpp"

cp "${PROJECT_DIR}/../node_modules/@nozbe/simdjson/src/simdjson.h" "${PROJECT_DIR}/../node_modules/@nozbe/watermelondb/native/shared/simdjson.h"

Hi,

My Environment:

React native: 0.65.1 Watermelon: 0.23.0

I was having the same problem. For me the problem was gone when i did two steps:

First: in the project_name-Bridging-Header.h i changed this part:

#import "../../node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/SupportingFiles/Bridging.h"

for this

#import "../node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/SupportingFiles/Bridging.h"

Second: i open projectname.xcworkspace with xcode and run my project with success.

Before I was opening the project file projectname.xcodeproj and i did receiving this error.

or you can compile the project with success running the command:

yarn ios or npm run ios in the root folder project

@backmeupplz Please read the changelog-unreleased & installation guide more carefully, and then tell me if you still run into troubles