Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Component for "RNCSlider" does not exist. #41

Closed
NoeFabellon opened this issue Apr 22, 2019 · 50 comments
Closed

Native Component for "RNCSlider" does not exist. #41

NoeFabellon opened this issue Apr 22, 2019 · 50 comments
Labels
question Further information is requested

Comments

@NoeFabellon
Copy link

I already installed it and import it but this error shows
"Native Component for "RNCSlider" does not exist."

@NoeFabellon NoeFabellon added the question Further information is requested label Apr 22, 2019
@brlocky
Copy link

brlocky commented Apr 22, 2019

I got the same

https://take.ms/tSM5O

@princiya
Copy link

+1 I have the same error.

@nikonhub
Copy link

+1

1 similar comment
@LG1710
Copy link

LG1710 commented Apr 23, 2019

+1

@LG1710
Copy link

LG1710 commented Apr 24, 2019

You need to link and it works :
react-native link @react-native-community/slider

@michalchudziak
Copy link
Collaborator

Yeah, exactly what @LG1710 said - you need to run react-native link @react-native-community/slider. Please check https://github.com/react-native-community/react-native-slider/blob/master/README.md for further instructions.

@pfeghali
Copy link

I don't think this should be closed - this did not fix it for me, I am still getting the same error

@bakkelim
Copy link

I don't think this should be closed - this did not fix it for me, I am still getting the same error

Same for me.
One thing to note is that I use Expo and have not ejected the app.
Do I have to eject the app in order to use this slider or should it work with Expo as well?

@aidanw
Copy link

aidanw commented May 3, 2019

I think I am also suffering from this problem. @michalchudziak could you look again?

This is the commit from running react-native link @react-native-community/slider

https://github.com/fo-am/iCrapAppPro/commit/0ab743a8ce1d05bf41b6ed122a2da8b12e4e9a61

I am okay on Android, but on Ios I get

Invariant Violation: Invariant Violation: Invariant Violation: requireNativeComponent: "RNCSlider" was not found in the UIManager.

The manual installation method has me drag something from PushNotificationIOS into my xcode... is this really what is meant?

@bobber205
Copy link

Having the same issue -- link command worked fine but for some reason I'm getting that same error.

I don't think the RN team should be alerting people to switch over to this package until this is resolved. Lots of man hours wasted collectively speaking.

@aidanw
Copy link

aidanw commented May 7, 2019

Do pod install in your ios folder and it works (for me).

@pfeghali
Copy link

pfeghali commented May 7, 2019

@aidanw what if users do not want to eject their application? This seems like a more fundamental issue with a native component that should not be breaking.

@aidanw
Copy link

aidanw commented May 8, 2019

I have never used any of the not ejected stuff so I am not sure of the limitations... but yeah this pretty fundamental ui element being funky is bad news.

@bobber205
Copy link

pod install fixed it for me as well -- I was under the assumption that the react native link did it as well? :P

@LLesage
Copy link

LLesage commented May 21, 2019

pod install if you're using cocoapods in your project. Worked for me.

@ajjubbal
Copy link

Running the following worked for me:

$ react-native link @react-native-community/slider
$ cd ios/
$ pod install
$ cd ..
$ npm run run:ios

That being said your README needs to be updated with this and your example needs to be fixed either with complete instructions on how to build and run or make it less cumbersome to run.

@ghost
Copy link

ghost commented May 29, 2019

Same error here
RNCSlider was not found in uimanager
"@react-native-community/slider": "^1.1.2",

@bobber205
Copy link

@muhammadwfa Did pod install not do the trick for you?

@ghost
Copy link

ghost commented Jun 2, 2019

Actually this was not an issue
I solved by react-native-link
@bobber205

@Stunner
Copy link

Stunner commented Jun 2, 2019

How did you end up solving it? @muhammadwfa

@ghost
Copy link

ghost commented Jun 2, 2019

by linking

react-native link @react-native-community/slider

@joIivier
Copy link

joIivier commented Jun 4, 2019

I had the same issue and for me this was due to the fact that I had overridden the ReactPackages in MainApplication.getPackages(). I had to add new ReactSliderPackage(); (imported from com.reactnativecommunity.slider.ReactSliderPackage;) to the returned list to fix this.

I don't know the iOS variant for this but the idea is that you have to ensure your native code advertises all the native packages you need, including your dependencies. react-native link doesn't do that (and should probably warn about ?).

@kurtmcintire
Copy link

kurtmcintire commented Jun 18, 2019

I'm seeing the same issue. Invariant violation: requireNativeComponent: "RNCSlider" was not found in the UIManager. I've tried re-linking using react-native link and react-native link @react-native-community/slider. I've tried running a manual pod install in the ios folder. And I've also tried blowing out and resetting all node modules.

My instance of Slider is imported like this:
import Slider from "@react-native-community/slider";

react-native-cli: 2.0.1
react-native: 0.59.4
react-native-slider: 1.1.3

Anyone else still seeing this issue?

@rckahale
Copy link

In my case it didn't work after re-linking.
This fixed it

  • npm start -- --reset-cache
  • Followed by installed app deletion from emulator/device.
  • Then react-native run-<os>

@cmacdonnacha
Copy link

Does this work without ejecting Expo?

@67millwood
Copy link

I've cleared cache, linked, ejected etc. No luck. I've seen bits online that it won't work with Expo but possibly i've read that wrong. Not explicit in the readme so assume that isn't the case.

@webraptor
Copy link

Yeah, exactly what @LG1710 said - you need to run react-native link @react-native-community/slider. Please check https://github.com/react-native-community/react-native-slider/blob/master/README.md for further instructions.

Readme doesn't contain that ...

@strobox
Copy link

strobox commented Jul 26, 2019

Same. Not working.

@webraptor
Copy link

Same. Not working.

Depending on your RN version you should either be on 1.X.X or 2.X.X.
after linking, make sure that you run pod install for ios as well.

@strobox
Copy link

strobox commented Jul 26, 2019

run pod install
Yes, helped for me. Lot of thanks!

@hsiaotinghung
Copy link

I had the same issue and for me this was due to the fact that I had overridden the ReactPackages in MainApplication.getPackages(). I had to add new ReactSliderPackage(); (imported from com.reactnativecommunity.slider.ReactSliderPackage;) to the returned list to fix this.

I don't know the iOS variant for this but the idea is that you have to ensure your native code advertises all the native packages you need, including your dependencies. react-native link doesn't do that (and should probably warn about ?).

This works for me to fix the same issue when running on android simulator!

@willedanielsson
Copy link

I'm seeing the same issue. Invariant violation: requireNativeComponent: "RNCSlider" was not found in the UIManager. I've tried re-linking using react-native link and react-native link @react-native-community/slider. I've tried running a manual pod install in the ios folder. And I've also tried blowing out and resetting all node modules.

My instance of Slider is imported like this:
import Slider from "@react-native-community/slider";

react-native-cli: 2.0.1
react-native: 0.59.4
react-native-slider: 1.1.3

Anyone else still seeing this issue?

I think its due to your React Native being of version < 0.6 but your Slider is version > 2.0. Either upgrade your React Native version or downgrade Slider to 1.x.x

@gabrielslach
Copy link

In my case it didn't work after re-linking.
This fixed it

* `npm start -- --reset-cache`

* Followed by installed app deletion from emulator/device.

* Then `react-native run-<os>`

this worked for me

@partriv
Copy link

partriv commented Aug 15, 2019

had the same issue, running react-native link, and pod install helped me as well. The README should be updated.

run pod install
Yes, helped for me. Lot of thanks!

@ptaberg
Copy link

ptaberg commented Aug 17, 2019

I solved it with the next steps:

  • yarn add @react-native-community/slider@1.1.3
  • react-native link
  • restart your project with react-native start --reset-cache
  • and command which has to be in you scripts rm -rf node-modules && yarn install && cd ios && rm Podfile.lock && pod install, and voila!

If you see this error again, so restart your server and just try to run one more time.

P.S. Remember, that default version of the component is 2, which supports react-native >0.60. If you have react-native <0.60, you need to install @react-native-community/slider@1.1.3.

@nikechanhk
Copy link

It is solved after running link.
I think it should be mentioned in the first page readme.

cruzach pushed a commit to expo/expo that referenced this issue Aug 21, 2019
* Update slider.md

See https://forums.expo.io/t/react-native-slider/25681. Using the community version (with SDK 0.34) results in the error described in forum post and callstack/react-native-slider#41

* Update slider.md

* Update slider.md
@jamesmcn1
Copy link

This works for me on RN 0.59

yarn add @react-native-community/slider@1.1.4
react-native link @react-native-community/slider
yarn add jetifier && yarn && npx jetify

yarn start --reset-cache #to reset the metro bundler

@ghost
Copy link

ghost commented Sep 12, 2019

Just had the same issue after migrating to the community slider component. Apparently after adding the package in iOS you also need to run pod install.
So run the command pod install in ios folder after the package is added.

@techtunix
Copy link

Do it like this!

1- npm install @react-native-community/slider –save
2- react-native link @react-native-community/slider
3- include in your script file like import { Slider } from 'react-native' instead of import Slider from '@react-native-community/slider';

then expo start --clear

hopefully work for someone.

@sandunmj
Copy link

Do it like this!

1- npm install @react-native-community/slider –save
2- react-native link @react-native-community/slider
3- include in your script file like import { Slider } from 'react-native' instead of import Slider from '@react-native-community/slider';

then expo start --clear

hopefully work for someone.

This worked for me.

@sudokzt
Copy link

sudokzt commented Jan 21, 2020

FYR: I got same issue. I challenged all the above solutions. But I couldn't.
Then I found out why I couldn't.
I use RN on Expo. Expo is not corresponded this library. So I can use previous react-native-slider.
https://facebook.github.io/react-native/docs/slider

[expo issue] expo/expo#4300

@ashish-padakannaya
Copy link

Do it like this!

1- npm install @react-native-community/slider –save
2- react-native link @react-native-community/slider
3- include in your script file like import { Slider } from 'react-native' instead of import Slider from '@react-native-community/slider';

then expo start --clear

hopefully work for someone.

Please accept my knees.

@Ahmed-Badawy
Copy link

@ashish-padakannaya this worked, thanks man...

@ddilhan
Copy link

ddilhan commented Mar 20, 2020

Do it like this!

1- npm install @react-native-community/slider –save
2- react-native link @react-native-community/slider
3- include in your script file like import { Slider } from 'react-native' instead of import Slider from '@react-native-community/slider';

then expo start --clear

hopefully work for someone.

you saved my day bro

@buschco
Copy link
Contributor

buschco commented Jul 10, 2020

@techtunix Whats the point of adding and linking the @react-native-community/slider at all if you use the deprecated one from react-native?

@Lemaro86
Copy link

Why you didn't write it in the readme? Just add rn link etc...
For RN 61 not working without manually linking for me.

@pachun
Copy link

pachun commented Oct 23, 2020

yarn add @react-native-community/slider
npx pod-install
npx react-native run-ios

Note the last line there. That's what I'd been missing. Rebuild your app after adding native dependencies.

@mstaicu
Copy link

mstaicu commented Jan 9, 2021

I think it's worth mentioning that one must build the app after linking the packages

@afilp
Copy link

afilp commented Feb 24, 2021

Can you reopen this please?

I also have the same problem with RN 0.63.

Shouldn't "autolinking" work without any other intervention from us? Is this the problem? The "autolinking" fails somehow?
It appears that with manual linking it works, so I would recommend that this is considered a problem (bug?) with the "autolinking" process.

Thanks!

@samdelong
Copy link

Restarting my Expo process worked for me (Using Expo 4.1.6)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests