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

Error when putting children inside <Slider/> component #512

Open
JuanMejiaC opened this issue May 26, 2023 · 3 comments
Open

Error when putting children inside <Slider/> component #512

JuanMejiaC opened this issue May 26, 2023 · 3 comments
Labels
bug report Something isn't working platform: Android Issue related to Android platform

Comments

@JuanMejiaC
Copy link

JuanMejiaC commented May 26, 2023

Environment

Expo version: 0.7.1
Android Emulator: Pixel_XL_API_30

  • react-native info output:
// react-native info
  • are you using the new architecture?
    yes
  • which version of react & react-native are you using?
    "react": "18.2.0",
    "react-native": "0.71.8",

Description

When running my project in the emulator this error happens: abi48_0_0.com.reactnativecommunity.slider.ReactSlider cannot be cast to android.view.ViewGroup
When running it on a physical iPhone device it just work.

Screenshot 2023-05-25 at 9 36 22 PM
Screenshot 2023-05-25 at 9 37 36 PM

Reproducible Demo

<Slider style={styles.slider} minimumValue={0} maximumValue={120} value={playBackTime.min + playBackTime.sec} minimumTrackTintColor={trackSliderColor} maximumTrackTintColor={textColorWhite} > <Text>{${playBackTime.hour}:${playBackTime.min}:${playBackTime.sec}</Text></Slider>

@JuanMejiaC JuanMejiaC added the bug report Something isn't working label May 26, 2023
@BartoszKlonowski
Copy link
Member

Hello @JuanMejiaC!
Please fill the missing information regarding new architecture and repro example.

@BartoszKlonowski BartoszKlonowski added the requires: author feedback Item requires some author's action label May 26, 2023
@JuanMejiaC
Copy link
Author

I'll figure out the problem. The problem is the Text component inside the Slider. But again it works fine on ios but not so on Adroid.

@BartoszKlonowski BartoszKlonowski added this to To be analyzed in Slider-Board via automation May 30, 2023
@BartoszKlonowski
Copy link
Member

@JuanMejiaC Placing children inside the Slider component was never intentionally supported - it means that by the nature of react-native it may work and it may work not on one version or another, or depending on the platform, or changes implemented to the Slider itself.
If you would like to solve the issue then checking the implementation of children handling on Android would be the first step. If you're willing to give it a try I can assign this issue to you.
Let me know.

@BartoszKlonowski BartoszKlonowski moved this from To be analyzed to Backlog in Slider-Board May 30, 2023
@BartoszKlonowski BartoszKlonowski moved this from Backlog to In Progress in Slider-Board Jun 16, 2023
@BartoszKlonowski BartoszKlonowski changed the title abi48_0_0.com.reactnativecommunity.slider.ReactSlider cannot be cast to android.view.ViewGroup Error when putting children inside <Slider/> component Jun 30, 2023
@BartoszKlonowski BartoszKlonowski added platform: Android Issue related to Android platform and removed requires: author feedback Item requires some author's action labels Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something isn't working platform: Android Issue related to Android platform
Projects
Slider-Board
  
In Progress
Development

No branches or pull requests

2 participants