Mark Roger Cabadsan
Mark Roger Cabadsan

Reputation: 61

Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED

I need to use react-native-scrollable-tab-view and accompanying that, I also installed/setup react-native-viewpager following this link. This error suddenly appeared and currently, I still can't find a way to solve it. I hope someone encountered it already and help me. I just started working with React Native 1 wk ago but this project I've been working on have been existing for more than a year so not all dependencies are updated including react-native which version is 0.59.10. I've already tried using react-native-scrollable-tab-view with a sample project using latest version of react-native and it works fine but unfortunately I don't think I can upgrade this project cause there are just so many dependencies that will be affected that complicates things. I hope there is a way to resolve it without having to affect other dependencies. Here is the error part of the log:

Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED /Users/markrogercabadsan/ReactNativeProjects/endless-aisle-hybrid/node_modules/react-native-gesture-handler/android/src/main/java/com/sw mansion/gesturehandler/react/RNGestureHandlerEvent.java:3: error: package android.support.v4.util does not exist import android.support.v4.util.Pools; ^ /Users/markrogercabadsan/ReactNativeProjects/endless-aisle-hybrid/node_modules/react-native-gesture-handler/android/src/main/java/com/sw mansion/gesturehandler/react/RNGestureHandlerEvent.java:19: error: package Pools does not exist private static final Pools.SynchronizedPool EVENTS_POOL = ^ /Users/markrogercabadsan/ReactNativeProjects/endless-aisle-hybrid/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:3: error: package android.support.v4.util does not exist import android.support.v4.util.Pools; ^ /Users/markrogercabadsan/ReactNativeProjects/endless-aisle-hybrid/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:19: error: package Pools does not exist private static final Pools.SynchronizedPool EVENTS_POOL = ^ /Users/markrogercabadsan/ReactNativeProjects/endless-aisle-hybrid/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:20: error: package Pools does not exist new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE); ^ /Users/markrogercabadsan/ReactNativeProjects/endless-aisle-hybrid/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:20: error: package Pools does not exist new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE); ^ Note: /Users/markrogercabadsan/ReactNativeProjects/endless-aisle-hybrid/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. 6 errors

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 24s 251 actionable tasks: 27 executed, 224 up-to-date error Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details. Marks-MacBook-Pro:endless-aisle-hybrid markrogercabadsan$

Upvotes: 0

Views: 5257

Answers (3)

Nivesh Nadarajan
Nivesh Nadarajan

Reputation: 1

Downgrade the react-native-gesture-handler version to 1.10.3

Upvotes: 0

Mark Roger Cabadsan
Mark Roger Cabadsan

Reputation: 61

This problem is already solved. Also, Thanks Mayank Pandav for pointing that out. As you thought, I forgot to run react-native link @react-native-community/viewpager since auto-linking is not done on react native versions < 0.60. After linking, I still had some problem, the usual error with Nullable thingy in react native android but I was able to solve it by migrating to AndroidX thru following this link and adding the following lines in my gradle.properties file:

android.useAndroidX=true;

android.enableJetifier=true;

And after re-running, the error is gone. Thanks everyone.

Upvotes: 0

Gaurav Roy
Gaurav Roy

Reputation: 12215

Try running this command in the android folde, and it hsoould solve it:

./gradlew assembleRelease -x bundleReleaseJsAndAssets 

Hope it helps.

Upvotes: 0

Related Questions