Execution failed for task ':react-native-gesture-handler:compileDebugJavaWithJavac'.
See original GitHub issueI 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 errorsFAILURE: 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:
- Created 4 years ago
- Reactions:4
- Comments:8 (1 by maintainers)
Top GitHub Comments
I think making the allProjects part of android->build.gradle like as follows fixed the problem
just run
npm install react-native-gesture-handler@1.0.5
and secend stepnpx jetify
then react-native run-android