question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build fails on Android. RNGestureHandlerPackage not found

See original GitHub issue

Description

I’m trying to build my app for android by doing ./gradlew bundlerelease, but I am getting errors. (See below for details)

Steps To Reproduce

  1. Follow installation instructions here: https://docs.swmansion.com/react-native-gesture-handler/docs/#installation
  2. Try to build the android app by doing ./gradlew bundlerelease

Expected behavior

App builds successfully

Actual behavior

App does not build.

Getting the following error:

> Task :app:compileReleaseJavaWithJavac FAILED
/Users/humad-home/tvproject-mobile/android/app/src/main/java/com/serializdmobile/MainApplication.java:11: error: cannot find symbol
import com.swmansion.gesturehandler.RNGestureHandlerPackage;
                                   ^
  symbol:   class RNGestureHandlerPackage
  location: package com.swmansion.gesturehandler
/Users/humad-home/tvproject-mobile/android/app/src/main/java/com/serializdmobile/MainApplication.java:12: error: cannot find symbol
import com.swmansion.gesturehandler.RNGestureHandlerPackage;
                                   ^
  symbol:   class RNGestureHandlerPackage
  location: package com.swmansion.gesturehandler
/Users/humad-home/tvproject-mobile/android/app/src/main/java/com/serializdmobile/MainApplication.java:13: error: cannot find symbol
import com.swmansion.gesturehandler.RNGestureHandlerPackage;
                                   ^
  symbol:   class RNGestureHandlerPackage
  location: package com.swmansion.gesturehandler
/Users/humad-home/tvproject-mobile/android/app/src/main/java/com/serializdmobile/MainApplication.java:14: error: cannot find symbol
import com.swmansion.gesturehandler.RNGestureHandlerPackage;
                                   ^
  symbol:   class RNGestureHandlerPackage
  location: package com.swmansion.gesturehandler
/Users/humad-home/tvproject-mobile/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:33: error: cannot find symbol
import com.swmansion.gesturehandler.RNGestureHandlerPackage;
                                   ^
  symbol:   class RNGestureHandlerPackage
  location: package com.swmansion.gesturehandler
/Users/humad-home/tvproject-mobile/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:104: error: cannot find symbol
      new RNGestureHandlerPackage(),
          ^
  symbol:   class RNGestureHandlerPackage
  location: class PackageList
Note: /Users/humad-home/tvproject-mobile/android/app/src/main/java/com/serializdmobile/MainActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
6 errors

FAILURE: Build failed with an exception.

Package versions

  • React: 16.13.1
  • React Native: 0.63.4
  • React Native Gesture Handler: git://github.com/software-mansion/react-native-gesture-handler.git#5572e8d65d73889f0bdb91f5aaa33cc1958971cd
    (For React Native Gesture Handler, I’m on the above commit which fixes modal issues)

Other notes

This is only an issue with Android. The iOS app builds perfectly. I was able to build the Android app a few days ago. Not sure why it has stopped building now. I can’t find anything in my project’s commit history that indicates a breaking change.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
Arkan4ikcommented, Dec 14, 2021

@mwegener-com have you found solution?

1reaction
Shiva207892commented, Sep 8, 2022

npm install --save react-native-gesture-handler

npx pod-install ios

Read more comments on GitHub >

github_iconTop Results From Across the Web

" com.swmansion.gesturehandler.react" ERROR APPEARS
I was copying mainapplication from old projects. My problem was this line: import com.swmansion.gesturehandler.react.RNGestureHandlerPackage ...
Read more >
[Solved]-Android 'react-native-gesture-handler' error-React ...
How to resolve the duplicate class error in between react native and android sdk? error Android project not found. Are you sure this...
Read more >
In-app-payments-react-native-plugin android sqip ...
... react-native-square-in-app-payments my android project no longer builds and throws the error: “error: package sqip.react does not exist” ...
Read more >
package com.swmansion.reanimated does not exist - You.com
I inherited a React Native app from consultants and am trying to get it to build on Android. When I run npx react-native...
Read more >
react-native-gesture-handler - npm
It makes touch interactions and gesture tracking not only smooth, ... Example within this repo can be found in the FabricExample README.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found