WatermelonDB
WatermelonDB copied to clipboard
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
Same happens on watermelondb version 0.23.0-11
Here's my Podfile in case you need it:
platform :ios, '12.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
inhibit_all_warnings!
target 'Todorant' do
# React native
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
# The rest
use_native_modules!
pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
pod 'Permission-Siri', :path => "#{permissions_path}/Siri.podspec"
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => true
end
target 'TodorantToday' do
pod 'Alamofire', '~> 5.0'
pod 'SwiftKeychainWrapper'
end
target 'TodorantHomescreen' do
pod 'Alamofire', '~> 5.0'
pod 'SwiftKeychainWrapper'
end
target 'TodorantIntents' do
pod 'Alamofire', '~> 5.0'
pod 'SwiftKeychainWrapper'
end
target 'Todorant-watchOS Extension' do
platform :watchos, '7.0'
pod 'Alamofire', '~> 5.0'
pod 'KeychainAccess'
end
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
And my bridging header:
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTViewManager.h>
#import <React/RCTBridgeModule.h>
#import "../../node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/SupportingFiles/Bridging.h"
I've got the dependency in the yarn.lock
, but not in the podfile lock 🤔
Hm, it doesn't look like simdjson.h
is a part of the binary
Version 0.22.0
works well though.
@backmeupplz Please read the changelog-unreleased & installation guide more carefully, and then tell me if you still run into troubles
did you get fix friend?? i have same issue with expo
"@nozbe/watermelondb": "^0.23.0", "react-native": "~0.63.4", "expo": "~42.0.1",
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => true
pod 'simdjson', path: '../node_modules/@nozbe/simdjson'
@rodrigogaraujo, have you run pod install
in your ios
directory?
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
I followed steps from installation guide and I've got the same problem using watermelondb version 0.24.0, any solution for that?
+1
Same problem here.
Hello guys,
This is what's worked for me:
-
Go to node_modules/@nozbe/simdjson/src
- Copy those 2 files “simdjson.cpp” and “simdjson.h”
-
Go to node_modules/@nozbe/watermelondb/native/shared
- Paste the files that you copied above “simdjson.cpp” and “simdjson.h”
- 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 ;)
+1
Here's my Podfile in case you need it:
platform :ios, '12.0' require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' inhibit_all_warnings! target 'Todorant' do # React native config = use_native_modules! use_react_native!(:path => config["reactNativePath"]) # The rest use_native_modules! pod 'RNReanimated', :path => '../node_modules/react-native-reanimated' pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler' pod 'react-native-camera', :path => '../node_modules/react-native-camera' permissions_path = '../node_modules/react-native-permissions/ios' pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec" pod 'Permission-Siri', :path => "#{permissions_path}/Siri.podspec" pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => true end target 'TodorantToday' do pod 'Alamofire', '~> 5.0' pod 'SwiftKeychainWrapper' end target 'TodorantHomescreen' do pod 'Alamofire', '~> 5.0' pod 'SwiftKeychainWrapper' end target 'TodorantIntents' do pod 'Alamofire', '~> 5.0' pod 'SwiftKeychainWrapper' end target 'Todorant-watchOS Extension' do platform :watchos, '7.0' pod 'Alamofire', '~> 5.0' pod 'KeychainAccess' end post_install do |pi| pi.pods_project.targets.each do |t| t.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' end end end
And my bridging header:
#import <React/RCTBundleURLProvider.h> #import <React/RCTRootView.h> #import <React/RCTViewManager.h> #import <React/RCTBridgeModule.h> #import "../../node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/SupportingFiles/Bridging.h"
You are missing the other two required pod lines - from the installation guide, section 3. : https://nozbe.github.io/WatermelonDB/Installation.html
pod 'WatermelonDB', :path => '../node_modules/@nozbe/watermelondb'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => true
pod 'simdjson', path: '../node_modules/@nozbe/simdjson'
hope that helps. Also. I had the same error but was because I had the pod install outside of the correct target . Once I put all 3 of those inside the main target, yarn install / cd ios && pod install worked as expected.
Building simdjson as a static library fixed it for me:
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
staticPods = ['simdjson']
if staticPods.include?(pod.name) then
puts "Fixing " + pod.name + " build type..."
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
Hello guys,
This is what's worked for me:
Go to node_modules/@nozbe/simdjson/src
- Copy those 2 files “simdjson.cpp” and “simdjson.h”
Go to node_modules/@nozbe/watermelondb/native/shared
- Paste the files that you copied above “simdjson.cpp” and “simdjson.h”
- 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.
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"
Should be fixed in 0.26