React-native-deck-swiper: Not working on Android real device

Created on 30 Jan 2019  路  7Comments  路  Source: alexbrillant/react-native-deck-swiper

Do you know how to use react-narive-deck-swiper by Expo?

I tried to use it on Android but it doesn't work (Not rendering).

However, it works on iOS in same code.

<Swiper
                    goBackToPreviousCardOnSwipeRight
                    disableRightSwipe={this.state.cardIndex === 0}
                    cards={finalData}
                    onSwipedLeft={ (cardIndex) => this.onSwiped(cardIndex, 'left')}
                    onSwipedRight={ (cardIndex) => this.onSwiped(cardIndex,'right')}
                    showSecondCard={false}
                    cardVerticalMargin={50}
                    renderCard={(card, index) => {
                        return (
                            <ScrollView contentContainerStyle={styles.card}>
                                <Text style={styles.text}>{card}</Text>
                                {
                                    index !== this.props.data.length
                                        ? <Text
                                            style={styles.pageNumber}>{`Page ${index + 1} / ${this.props.data.length}`}</Text>
                                        : null
                                }
                            </ScrollView>
                        )
                    }}
                    onSwipedAll={() => {
                        this.props.navigation.navigate('Rating', {level: this.props.level});                        
                    }}
                    backgroundColor={'transparent'}
                    stackSize={this.props.data.length}>
</Swiper>

```

Most helpful comment

I believe that the react-native-view-overflow dependency _does_ break this on android -- consistently getting an error:

requireNativeComponent: "RNViewOverflow" was not found in the UIManager

I believe this happens because on Expo the linking step can't occur.

This was introduced in #222 -- I didn't have any issues until after that update.

@baophamtd did you get this working on a version beyond that pull request, on an Andorid, AND on Expo?

EDIT:
By setting the 'UseViewOverflow' Prop false on Android, it'll work on Expo :)
Example:

```
import { Platform } from 'react-native'

...

...props
useViewOverflow={Platform.OS === 'ios'}
/>

All 7 comments

@KoheiTigers I have tested with my device for both new testing app and my current app. I think it still works fine. You might want to do a little more debug. My bad for saying it does not work before :(

I believe that the react-native-view-overflow dependency _does_ break this on android -- consistently getting an error:

requireNativeComponent: "RNViewOverflow" was not found in the UIManager

I believe this happens because on Expo the linking step can't occur.

This was introduced in #222 -- I didn't have any issues until after that update.

@baophamtd did you get this working on a version beyond that pull request, on an Andorid, AND on Expo?

EDIT:
By setting the 'UseViewOverflow' Prop false on Android, it'll work on Expo :)
Example:

```
import { Platform } from 'react-native'

...

...props
useViewOverflow={Platform.OS === 'ios'}
/>

@JacobJaffe You saved my life, thank you!! Was banging my head against the wall why it didn't work on a real android device and was crashing my app.

@JacobJaffe
Thank you for your advices and I'm sorry for replying so late.
I solved this issue

Is react-native-view-overflow somehow involved when the labels on the cards are shown? Because I just realize that there are no labels on the cards on android.

Hi, I have updated expo sdk 33 to sdk 34 and now this happens to me Unable to resolve "react-native-view-overflow" from "node_modules / react-native-deck-swiper / Swiper.js"
It seems that a dependency on react-native-deck-swiper is missing.
How can I solve this?
"react-native-deck-swiper": "^ 1.5.22",

@mightym I am having the same issue. Did you ever manage to fix it? I suspect it has to do with styling options
This worked for me https://github.com/alexbrillant/react-native-deck-swiper/issues/126#issuecomment-392390432

Was this page helpful?
0 / 5 - 0 ratings