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.

Execution failed for task ':react-native-gesture-handler:compileDebugJavaWithJavac'.

See original GitHub issue

I get this Error when i build my app.

`> Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:17: error: package com.facebook.react.module.annotations does not exist import com.facebook.react.module.annotations.ReactModule; ^ C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:20: error: cannot find symbol import com.facebook.react.uimanager.UIBlock; ^ symbol: class UIBlock location: package com.facebook.react.uimanager C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:41: error: cannot find symbol @ReactModule(name=RNGestureHandlerModule.MODULE_NAME) ^ symbol: class ReactModule C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRootViewManager.java:4: error: package com.facebook.react.module.annotations does not exist import com.facebook.react.module.annotations.ReactModule; ^ C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerRootViewManager.java:17: error: cannot find symbol @ReactModule(name = RNGestureHandlerRootViewManager.REACT_CLASS) ^ symbol: class ReactModule C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerButtonViewManager.java:218: error: cannot find symbol @ReactProp(name = ViewProps.BORDER_RADIUS) ^ symbol: variable BORDER_RADIUS location: class ViewProps C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\facebook\react\views\modal\RNGHModalUtils.java:15: error: package ReactModalHostView does not exist
((ReactModalHostView.DialogRootViewGroup) modal).onChildStartedNativeGesture(androidEvent); ^ C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\facebook\react\views\modal\RNGHModalUtils.java:19: error: package ReactModalHostView does not exist
return modal instanceof ReactModalHostView.DialogRootViewGroup; ^ C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerEvent.java:41: error: method init in class Event<T> cannot be applied to given types; super.init(handler.getView().getId()); ^ required: int,long found: int reason: actual and formal argument lists differ in length where T is a type-variable: T extends Event declared in class Event C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:575: error: cannot find symbol final int rootViewTag = uiManager.resolveRootTagFromReactTag(ancestorViewTag); ^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type UIManagerModule C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:584: error: cannot find symbol if (rootView instanceof ReactRootView && ((ReactRootView) rootView).getRootViewTag() == rootViewTag) { ^ symbol: method getRootViewTag() location: class ReactRootView C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:600: error: cannot find symbol uiManager.addUIBlock(new UIBlock() { ^ symbol: class UIBlock location: class RNGestureHandlerModule C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:636: error: cannot find symbol int rootViewTag = uiManager.resolveRootTagFromReactTag(viewTag); ^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type UIManagerModule C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerModule.java:644: error: cannot find symbol if (rootView instanceof ReactRootView && ((ReactRootView) rootView).getRootViewTag() == rootViewTag) { ^ symbol: method getRootViewTag() location: class ReactRootView C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerPackage.java:18: error: RNGestureHandlerPackage is not abstract and does not override abstract method createJSModules() in ReactPackage public class RNGestureHandlerPackage implements ReactPackage { ^ C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerStateChangeEvent.java:45: error: method init in class Event<T> cannot be applied to given types; super.init(handler.getView().getId()); ^ required: int,long found: int reason: actual and formal argument lists differ in length where T is a type-variable: T extends Event declared in class Event C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNViewConfigurationHelper.java:45: error: cannot find symbol return parent.getChildAt(((ReactViewGroup) parent).getZIndexMappedChildIndex(index)); ^ symbol: method getZIndexMappedChildIndex(int) location: class ReactViewGroup C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNViewConfigurationHelper.java:54: error: cannot find symbol String overflow = ((ReactViewGroup) view).getOverflow(); ^ symbol: method getOverflow() location: class ReactViewGroup Note: C:\Users.…\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 18 errors

FAILURE: Build failed with an exception.`

I am using :

“scripts”: { “test”: “jest”, “android”: “react-native run-android”, “ios”: “react-native run-ios”, “start”: “react-native start”, “lint”: “eslint .”, “jetify”: “npx jetify” }, “dependencies”: { “@react-native-community/netinfo”: “^5.3.3”, “babel-preset-expo”: “^5.0.0”, “base64-js”: “^1.3.0”, “crypto-js”: “^3.1.9-1”, “dateformat”: “^3.0.3”, “formik”: “^1.5.1”, “i18n-js”: “^3.1.0”, “json2csv”: “^4.3.3”, “lodash”: “^4.17.15”, “mime”: “^2.4.0”, “moment”: “^2.23.0”, “native-base”: “^2.13.7”, “prop-types”: “^15.6.2”, “react”: “16.9.0”, “react-native”: “0.61.5”, “react-native-action-button”: “^2.7.0”, “react-native-charts-wrapper”: “^0.5.7”, “react-native-document-picker”: “^2.1.0”, “react-native-drawer”: “^2.3.0”, “react-native-elements”: “^1.1.0”, “react-native-exit-app”: “^1.0.0”, “react-native-file-picker”: “0.0.12”, “react-native-file-viewer”: “^2.0.0”, “react-native-firebase”: “^5.6.0”, “react-native-fs”: “^2.15.2”, “react-native-gesture-handler”: “^1.6.0”, “react-native-google-drive-api”: “^1.0.22”, “react-native-google-drive-api-wrapper”: “^1.1.22”, “react-native-google-signin”: “^2.0.0”, “react-native-html-to-text”: “0.0.5”, “react-native-image-crop-picker”: “^0.21.3”, “react-native-image-picker”: “^0.26.3”, “react-native-keyboard-aware-scroll-view”: “^0.7.2”, “react-native-languages”: “^3.0.2”, “react-native-linear-gradient”: “^2.5.3”, “react-native-loading-spinner-overlay”: “^0.5.2”, “react-native-modal”: “^9.0.0”, “react-native-modal-datetime-picker”: “^7.6.0”, “react-native-modal-filter-picker”: “^1.3.4”, “react-native-onesignal”: “^3.2.4”, “react-native-pdf”: “^5.0.11”, “react-native-pie”: “^0.4.0”, “react-native-popup-dialog”: “^0.17.0”, “react-native-selectme”: “^1.2.3”, “react-native-sensor-manager”: “^0.1.10”, “react-native-simple-radio-button”: “^2.7.1”, “react-native-simple-toast”: “0.0.8”, “react-native-smart-barcode”: “^1.0.6”, “react-native-spinkit”: “^1.4.1”, “react-native-step-indicator”: “0.0.9”, “react-native-svg”: “^9.3.1”, “react-native-tags”: “^2.0.0”, “react-native-timeago”: “^0.4.0”, “react-native-typography”: “^1.4.0”, “react-native-vector-icons”: “^6.2.0”, “react-navigation”: “^3.8.1”, “react-navigation-redux-helpers”: “^3.0.0”, “react-redux”: “^5.0.7”, “realm”: “^2.29.2”, “redux”: “^4.0.0”, “redux-thunk”: “^2.3.0”, “rn-fetch-blob”: “^0.10.15”

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gypsicodercommented, Apr 15, 2020

I think making the allProjects part of android->build.gradle like as follows fixed the problem

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
         maven {
                        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                        url "$rootDir/../node_modules/react-native/android"
            }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven { url 'https://www.jitpack.io' }

    }
}
0reactions
ArminShahamaticommented, Sep 13, 2020

just run npm install react-native-gesture-handler@1.0.5 and secend step npx jetify

then react-native run-android

Read more comments on GitHub >

github_iconTop Results From Across the Web

Execution failed for task ':react-native-gesture-handler ...
I am fixing a incompatibility issue related to AndroidX by adding 2 lines to gradle.properties under android for my RN 0.59.5 project.
Read more >
Execution Failed for task :app:compileDebugJavaWithJavac in ...
In Android Studio 3.1, you can see the errors details in the Build window. Open up Build tab. They are somewhat hidden, you...
Read more >
Android studio | Execution failed for task - YouTube
Here, given trick to solve this type of error. Execution failed for task ':app:checkDebugAarMetadata'. Could not resolve all files for ...
Read more >
Android Gradle Build Fails With "execution Failed For Task
Trying to make an Android build and a little unsure what exactly is going on with this error. Could use any suggestions anyone...
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