I am beginner in react-native. While building my app for android, I am getting this error
Task :react-native-community_toolbar-android:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
39 actionable tasks: 39 executed
Note: /home/kanhaiya/testapp/node_modules/@react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/home/kanhaiya/testapp/node_modules/@react-native-community/toolbar-android/android/src/main/java/com/reactnativecommunity/toolbarandroid/ReactToolbar.java:107: error: IconImageInfo is not abstract and does not override abstract method getExtras() in HasImageMetadata
private static class IconImageInfo implements ImageInfo {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':react-native-community_toolbar-android:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 25s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: /home/kanhaiya/testapp/node_modules/@react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/home/kanhaiya/testapp/node_modules/@react-native-community/toolbar-android/android/src/main/java/com/reactnativecommunity/toolbarandroid/ReactToolbar.java:107: error: IconImageInfo is not abstract and does not override abstract method getExtras() in HasImageMetadata
private static class IconImageInfo implements ImageInfo {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':react-native-community_toolbar-android:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 25s
at makeError (/home/kanhaiya/testapp/node_modules/execa/index.js:174:9)
at /home/kanhaiya/testapp/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (/home/kanhaiya/testapp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/home/kanhaiya/testapp/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:192:9)
I have already linked react-native-community/toolbar-android
in my project using react-native link @react-native-community/toolbar-android
. Still it is giving error.
after running yarn upgrade @react-native-community/toolbar-android@^0.2.1, the problem is gone.If you are using npm then update the package to the latest.Happy Coding :)