Swipe Gestures not Working in Android- React Native Gesture Handler

Hello Guys, After the last updates many of React Native developers are facing the issue with the gestures. I am getting many emails regarding that so here I have planned to post the solution for Swipe Gestures not Working in Android- React Native Gesture Handler.

As per my experience of React Native development, I usually face the dependency integration problem with iOS instead of Android but this time it’s different because if you test the app with gesture in iOS devices then it will work very perfect but for the Android, you will face the issue.

For those who haven’t faced this issue or have no idea what I am talking about, after integrating reactnativegesturehandler in your app you can enable the swipe gestures for Tab and Navigation Drawer. swipe example for the Tab and Drawers can be:

  1. Change the Tab screen by swiping right to left or right to left
  2. Swipe out the navigation drawer by swiping left to right or can swipe in the drawer by clicking outside of the drawer

So that was the general things which you can notice. In the last few updates, they have done lots of changes and developers are now facing the issue with the swipe gestures in the Android device only. So for that, you have to do some changes manually in your MainActivity so that you can solve this issue if swipe gesture in Android.

To Solve Swipe Gestures not Working

1. Navigate to the Project -> android -> app -> src -> main -> java -> com -> project -> MainActivity.java

2. Add the following additional lines below import (Screenshot below for the help)

3. Add a new method in Class

Screenshot for the reference (Plus signs to denote the additional lines)

Complete screenshot after the change

This is how you can solve the problem of Swipe Gestures not Working in Android. Hope this will work. If you are facing any kind of issue then you can comment below so that everyone can know about the different possibilities of failure.

Hope you liked it. 🙂

7 thoughts on “Swipe Gestures not Working in Android- React Native Gesture Handler”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.