prscX / react-native-spruce

React Native Bridge for Native Spruce Animation Library
https://github.com/willowtreeapps/spruce-android
Apache License 2.0
531 stars 33 forks source link

Invariant Violation: Native component for "RNSpruceView" does not exist #2

Closed joaoalbertocsjunior closed 6 years ago

joaoalbertocsjunior commented 6 years ago

What i did:

react-native init myproject

cd myproject

yarn add react-native-spruce

react-native link

copy-paste how to use section on readme.

What i got:

Invariant Violation: Native component for "RNSpruceView" does not exist

https://ibb.co/kJ2zEG

prscX commented 6 years ago

Thanks @joaoalbertocsjunior for reporting the issue.

Looking like the library is not linked to your app. Can you please verify whether the library is adding into your android app: settings.grade, build.gradle and MainApplication.

You can run below command to again link the library

react-native link react-native-spruce

Please let me know in case it does not work.

Thanks Pranav

joaoalbertocsjunior commented 6 years ago

I'd like to thank you for these awesome modules and for the fast reply!

I've checked, and it appears that automatic linking does not link it to build.gradle

How should i manually link it?

prscX commented 6 years ago

Thanks @joaoalbertocsjunior for the appreciation 😊

For manually linking, there 3 files we need to change in order to link any library:

Hope this will provide some context on how to achieve manually linking any library

Thanks Pranav