# Swipeable is not working on android?

**URL:** <https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556>\
**Category:** React Native\
**Created:** [December 31, 2021, 7:20am UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556 "2021-12-31T07:20:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pravinkumarosingh](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@pravinkumarosingh](https://forum.codewithmosh.com/u/pravinkumarosingh)\
**Post date:** [December 31, 2021, 7:20am UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556/1 "2021-12-31T07:20:38Z")

</div>

here is my MessagesScreen.js

```auto
import React from 'react';

import { FlatList, StyleSheet, View} from 'react-native';

import ListItem from '../components/ListItem';

import ListItemSeparator from '../components/ListItemSeparator';

import Screen from '../components/Screen';

const messages = [

    {

        id: 1,

        title:"T1",

        description:"D1",

        image: require("../assets/mosh.jpg")

    },

    {

        id: 2,

        title:"T2",

        description:"D2",

        image: require("../assets/mosh.jpg")

    }

]

function MessagesScreen(props) {

    return (

        <Screen>

        <FlatList

            data={messages}

            KeyExtractor={message => message.id.toString()}

            renderItem={({item}) => (<ListItem title={item.title}

                                           subTitle={item.description}

                                           image={item.image}

                                           onPress={()=>console.log("Message Selected", item)}

                                           renderRightActions={()=>(<View style={{

                                               backgroundColor: "red",

                                               width:70

                                           }}></View>)}/>)}

            ItemSeparatorComponent={ListItemSeparator}/>

        </Screen>

    );

}

const styles = StyleSheet.create({

   

})

export default MessagesScreen;

```

and here ListItem.js

```auto
import React from 'react';

import { View, StyleSheet, Image, TouchableHighlight } from 'react-native';

import AppText from './AppText';

import colors from '../config/colors';

import Swipeable from 'react-native-gesture-handler/Swipeable';

function ListItem({title, subTitle, image, onPress, renderRightActions}) {

    return (

       <Swipeable renderRightActions={renderRightActions}>

        <TouchableHighlight underlayColor={colors.light} onPress={onPress}>

            <View style={styles.container}>

                <Image style={styles.image} source={image}/>

               

                <View>

                    <AppText style={styles.title}>{title}</AppText>

                    <AppText style={styles.subTitle}>{subTitle}</AppText>

                </View>

       

            </View>

        </TouchableHighlight>

       </Swipeable>

    );

}

const styles = StyleSheet.create({

    container:{

        flexDirection:"row",

        padding: 15

    },

    image:{

        width:70,

        height:70,

        borderRadius: 35,

        marginRight:10

    },

    title:{

        fontWeight: "bold"

    },

    subTitle:{

        color:colors.medium

    }

})

export default ListItem;

```

---

<div class="post-metadata">

**Author:** ![Kris](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@Kris](https://forum.codewithmosh.com/u/Kris)\
**Post date:** [January 1, 2022, 12:14am UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556/3 "2022-01-01T00:14:09Z")

</div>

It has taken me hours, but I finally found a solution. Try this:

All it involves is wrapping the entire thing around a

```auto
import { GestureHandlerRootView } from "react-native-gesture-handler";

function ListItem({ title, subtitle, image, onPress, renderRightActions }) {
  return (
    <GestureHandlerRootView>
      <Swipeable renderRightActions={renderRightActions}>
        <TouchableHighlight underlayColor={colors.light} onPress={onPress}>
          <View style={styles.container}>
            <Image style={styles.image} source={image} />
            <View>
              <AppText style={styles.title}>{title}</AppText>
              <AppText style={styles.subTitle}>{subtitle}</AppText>
            </View>
          </View>
        </TouchableHighlight>
      </Swipeable>
    </GestureHandlerRootView>
  );
}

```

---

<div class="post-metadata">

**Author:** ![pravinkumarosingh](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@pravinkumarosingh](https://forum.codewithmosh.com/u/pravinkumarosingh)\
**Post date:** [January 1, 2022, 4:03am UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556/4 "2022-01-01T04:03:28Z")

</div>

Hey Kris,  
Thank You for the help. It worked after wrapping it with GestureHandlerRootView.

---

<div class="post-metadata">

**Author:** ![gerome94](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@gerome94](https://forum.codewithmosh.com/u/gerome94)\
**Post date:** [January 23, 2022, 4:25am UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556/5 "2022-01-23T04:25:59Z")

</div>

Wow…Nowhere does it mention to wrap it in a GestureHandlerRootView but now it works. THANKS!

---

<div class="post-metadata">

**Author:** ![JacobCohen](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@JacobCohen](https://forum.codewithmosh.com/u/JacobCohen)\
**Post date:** [January 24, 2023, 8:53pm UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556/6 "2023-01-24T20:53:25Z")

</div>

Hello there,

It seems that this solution does NOT work in Android 12 API 31.  
I’m rather frustrated by this.

Took the code from the site (‘END’ version - and it still doesn’t work even after I’ve added the ‘GestureHandlerRootView’ hack)

Any help will be much appreciated.

It looks as if the Android guys are doing the best they can to avoid supporting the swipe ability.

Thanks,  
Jacob

---

<div class="post-metadata">

**Author:** ![fyihany](https://avatars.discourse-cdn.com/v4/letter/f/8e7dd6/32.png) [@fyihany](https://forum.codewithmosh.com/u/fyihany)\
**Post date:** [February 24, 2023, 10:01am UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556/7 "2023-02-24T10:01:32Z")

</div>

Thank you Kris, it worked.

---

<div class="post-metadata">

**Author:** ![dagdaj](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dagdaj](https://forum.codewithmosh.com/u/dagdaj)\
**Post date:** [February 26, 2023, 8:28pm UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556/8 "2023-02-26T20:28:48Z")

</div>

Kris’ suggestion worked like a peach for me.

---

<div class="post-metadata">

**Author:** ![luana](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@luana](https://forum.codewithmosh.com/u/luana)\
**Post date:** [April 27, 2023, 5:49pm UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556/9 "2023-04-27T17:49:14Z")

</div>

did you fix it ? also could not render the action even wrapping with the gesture handler root view

---

<div class="post-metadata">

**Author:** ![Shreyash](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shreyash](https://forum.codewithmosh.com/u/Shreyash)\
**Post date:** [December 31, 2023, 1:21pm UTC](https://forum.codewithmosh.com/t/swipeable-is-not-working-on-android/9556/10 "2023-12-31T13:21:13Z")

</div>

Works. Thanks! (using on Pixel 7 virtual device)
