json.hpp was not imported into the project, the compilation failed
*Realm 2.27.0
*Realm 2.27.0
Hey - looks like you forgot to add a T:* label - could you please add one?
Hey - looks like you forgot to add a T:* label - could you please add one?
Don't know how to add a T:* label
@bmunkholm why closing this issue?
@sheodon closed this - looked like the bot's request to add a label was the only reason to reopen?
If there is still a problem, please use the template to explain in more details what the problem is and how to replicate the issue.
@sheodon closed this - looked like the bot's request to add a label was the only reason to reopen?
If there is still a problem, please use the template to explain in more details what the problem is and how to replicate the issue.
It was accidentally closed by me, so i reopen it
@sheodon Please use the full template. Describe exactly how to reproduce your issue. Thanks!
@sheodon Please use the full template. Describe exactly how to reproduce your issue. Thanks!
when realmjs's version 2.27.0, xcode version 10.2.1 can compile success, but xcode version 10.1 compile fail。
when realmjs's version 2.26.1, xcode version 10.1 can compile success。
when realmjs's version:2.27.0 , i found json.hpp was not imported into the project
@sheodon
I haven't been able to reproduce it yet. If possible, can you provide a small app which does?
I've experienced same error when running react-native run-ios after upgrading realm. However, when compiling with Xcode, everything worked fine.
I couldn't reproduce the issue in a fresh project.
Error:
<path_to_project>/node_modules/realm/src/rpc.hpp:26:10: fatal error: 'json.hpp' file not found
#include "json.hpp"
^~~~~~~~~~
1 error generated.
We moved the file recently, so I can easily imagine an upgrade can cause issues. Clearing the build files will probably help.
@kneth thanks, indeed after removing ios/build compilation via react-native run-ios worked again 😬
https://github.com/realm/realm-js/blob/cd579770ad50bba5ce6dcfa89591334fd1735c53/src/rpc.hpp#L26
This is the file that is including the missing json.hpp
The json.hpp file is not in the repository.
https://github.com/realm/realm-js/tree/cd579770ad50bba5ce6dcfa89591334fd1735c53/src
Could you please explain how removing ios/build folder and rebuilding fixes this?
We use git submodules to include a number of other repositories. As our object store (shared between all our SDKs) recently got a need for json.hpp, we decided to move the file to that repository.
@kneth thanks for the explanation!
Still getting this on 2.28.1, when cloning from fresh.
XCode 10.2.1, Node 8.16.0
@mattpocock After cloning, did you also initialize and update the submodules?
I had the same issue using Realm 2.28.1. What solved the issue for me was the following:
1) Unlink RealmReact from my project
2) Do a yarn upgrade realm
3) Manually link RealmReact again (by dragging RealmReact.xcodeproj into the libraries folder in Xcode and by linking libRealmReact.a)
I'm using Xcode 10.2.1 btw
@mkremer-jemmic Your procedure is supporting my comment.
Thanks!
How I fixed this:
1) Remove RealmReact.xcodeproj in dir /Libraties my Xcode-project
2) $ yarn upgrade realm
3) $ react-native link
4) Control shot: Drag .../node_modules/realm/react-native/ios/RealmReact.xcodeproj to dir /Libraties my Xcode-project
Most helpful comment
@kneth thanks, indeed after removing
ios/buildcompilation viareact-native run-iosworked again 😬