react-native: 3rd party lib compile failed after upgrading to 0.57.2 or newer

Environment

[skip envinfo] “react”: “16.6.0-alpha.8af6728”, “react-native”: “0.57.4”, Android Platform.

`react-native info` stuck 

Description

All 3rd-party library compile failed after upgrading from 0.57.1 to newer version

One of these lib.

Task :react-native-gesture-handler:compileReleaseJavaWithJavac FAILED /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:16: error: package com.facebook.react.module.annotations does not exist import com.facebook.react.module.annotations.ReactModule; ^ /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:19: error: cannot find symbol import com.facebook.react.uimanager.UIBlock; ^ symbol: class UIBlock location: package com.facebook.react.uimanager /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:40: error: cannot find symbol @ReactModule(name=RNGestureHandlerModule.MODULE_NAME) ^ symbol: class ReactModule /Users/dengguo/dev/novelsearcher/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; ^ /Users/dengguo/dev/novelsearcher/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 /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java:196: error: cannot find symbol @ReactProp(name = ViewProps.BORDER_RADIUS) ^ symbol: variable BORDER_RADIUS location: class ViewProps /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:574: error: cannot find symbol final int rootViewTag = uiManager.resolveRootTagFromReactTag(ancestorViewTag); ^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type UIManagerModule /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:582: error: cannot find symbol if (root.getRootView().getRootViewTag() == rootViewTag) { ^ symbol: method getRootViewTag() location: class ReactRootView /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:598: error: cannot find symbol uiManager.addUIBlock(new UIBlock() { ^ symbol: class UIBlock location: class RNGestureHandlerModule /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:634: error: cannot find symbol int rootViewTag = uiManager.resolveRootTagFromReactTag(viewTag); ^ symbol: method resolveRootTagFromReactTag(int) location: variable uiManager of type UIManagerModule /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java:641: error: cannot find symbol if (root.getRootView().getRootViewTag() == rootViewTag) { ^ symbol: method getRootViewTag() location: class ReactRootView /Users/dengguo/dev/novelsearcher/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 /Users/dengguo/dev/novelsearcher/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 /Users/dengguo/dev/novelsearcher/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 { ^ /Users/dengguo/dev/novelsearcher/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.java:44: error: cannot find symbol return parent.getChildAt(((ReactViewGroup) parent).getZIndexMappedChildIndex(index)); ^ symbol: method getZIndexMappedChildIndex(int) location: class ReactViewGroup Note: /Users/dengguo/dev/novelsearcher/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. 15 errors

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15

Most upvoted comments

i dont know why React Native have so many problems.

After struggling a couple of hours with it I removed node_modules folder, deleted yarn.lock file and reinstalled dependencies and it worked! Still, don’t know what exactly was going on but I hope it helps…

“react”: “16.8.3”, “react-native”: “0.59.2”, “react-native-gesture-handler”: “^1.1.0”,

@eyalabadi98 no, still using 0.57.1. you ?