native-navigation icon indicating copy to clipboard operation
native-navigation copied to clipboard

How to install Libraries Like Realm

Open FlaviooLima opened this issue 8 years ago • 12 comments

Hi, I'm currently trying to install Realm, but with no success. How can i do this?

FlaviooLima avatar Apr 12 '17 09:04 FlaviooLima

This doesn't have anything to do with navigation

satya164 avatar Apr 12 '17 10:04 satya164

Can i just do npm install realm and react-native link realm? I thought that i had to do this in a different way because of this library.

FlaviooLima avatar Apr 12 '17 11:04 FlaviooLima

I thought that i had to do this in a different way because of this library.

You don't have to do anything differently because of this library.

Kureev avatar Apr 12 '17 12:04 Kureev

@Kureev @satya164 thank you very much.

FlaviooLima avatar Apr 12 '17 13:04 FlaviooLima

@Kureev and @satya164 this is not working on my side as well. Steps I did:

  • created vanilla react native project
  • add and setup native-navigation
  • navigation works awesomely
  • I setup realm by doing:
 npm install --save realm
 react-native link realm

and it shows the "Unknown execution context" error.

As soon as I repeat the same steps without adding and setting up native-navigation, it works, realm setup works awesomely.

Any ideas? Thanks 🙌🏼

ps. @flaviotobi did you ever get it to work along native-navigation?

screen shot 2017-04-21 at 00 51 26

pincheira avatar Apr 20 '17 22:04 pincheira

@jpincheira To be honest I do not know xD, I connect the realm manually, but it starts to give me a different error, but I believe the realm has been linked successfully. Now I'm not working with this librarie, but probably tomorrow I'll start over again so in the mean time just try manual link to the realm of iOS Project. And then tell me how it goes :)

FlaviooLima avatar Apr 21 '17 08:04 FlaviooLima

@flaviotobi thanks! I tried what you said, but linkage didn't work for me manually with the app. Same error screen.

Native Navigation still doesn't work as promised for now. You cannot install dependencies like Realm. The distinction between what should you really manage, if pods or NPM packages, is not well defined. Hope this gets to 1.0 soon as we can actually use it for most cases.

pincheira avatar Apr 28 '17 10:04 pincheira

@jpincheira I'm gonna reopen this issue to see if anyone can help you :) And by the way, can you just try to start a new project with this libraries and after the first run on device (to check if it works the app) try again to install realm and linking manually ?

FlaviooLima avatar Apr 28 '17 11:04 FlaviooLima

There's actually an issue related to this here but until they get around to adding pod integration you can try the following, it worked for me.

In the RealmReact xcode project file add

$(SRCROOT)/../../../../ios/Pods/Headers/Public

so that it can access the React headers.

In your xcode project add the libRealmReact.a static library under 'Linked Frameworks and Libraries'. Also make sure that the following is added to your header search paths.

$(SRCROOT)/../node_modules/realm/src

benvest avatar Apr 29 '17 00:04 benvest

Hi @jpincheira!

In order to help you I have to ask a few questions:

  • What makes you think that realm installation is related to native-navigation? Did it work before (and stopped after native-navigation installation)?
  • Based on your stack trace screenshot, I can conclude that most likely we can figure out the problem if you share part of your Home.js around line 22 & index.js around lines 60-70. Can you, please?

Kureev avatar Apr 30 '17 15:04 Kureev

I am having a really hard time getting realm working with native-navigation too. I have been following along this post with no luck. I am working on a project built off of the native-navigation boilerplate.. at which point:

  1. npm install --save realm

2.drag RealmReact.xcodeproj file into my ReactNativeStarter.xcodeproj and include header search paths as described above and link libRealmReact.a framework. (alternativley react-native link realm seems to have the same effect???)

  1. when I build I am getting an error that 'React/RCTBridgeDelegate.h' file not found in node_modules/realm/react0native/ios/RealmReact. (I notice that the Pods/Header/ folder is completely empty)

Did I miss a step?

natwales avatar May 09 '17 16:05 natwales

@pukeanddie Could it be that you're installing RealmReact version, incompatible with your react-native version?

Kureev avatar May 10 '17 08:05 Kureev