Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
149
rated 0 times [  151] [ 2]  / answers: 1 / hits: 9421  / 4 Years ago, sat, may 30, 2020, 12:00:00

I keep getting this error, when I try running my React Native application after installing the react-native.webview package. Please what could I be doing wrong.



info Running jetifier to migrate libraries to AndroidX. You can disable it using --no-jetifier flag.
Jetifier found 1135 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details

> Task :react-native-webview:compileDebugJavaWithJavac

> Task :react-native-webview: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.0.1/userguide/command_line_interface.html#sec:command_line_warnings
79 actionable tasks: 14 executed, 65 up-to-date
C:ProjectsReact-NativeFUNAInode_modulesreact-native-webviewandroidsrcmainjavacomreactnativecommunitywebviewRNCWebViewModule.java:276: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
^
symbol: variable Q
location: class VERSION_CODES
Note: C:ProjectsReact-NativeFUNAInode_modulesreact-native-webviewandroidsrcmainjavacomreactnativecommunitywebviewRNCWebViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:ProjectsReact-NativeFUNAInode_modulesreact-native-webviewandroidsrcmainjavacomreactnativecommunitywebviewRNCWebViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-webview: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 1m 37s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:ProjectsReact-NativeFUNAInode_modulesreact-native-webviewandroidsrcmainjavacomreactnativecommunitywebviewRNCWebViewModule.java:276: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
^
symbol: variable Q
location: class VERSION_CODES
Note: C:ProjectsReact-NativeFUNAInode_modulesreact-native-webviewandroidsrcmainjavacomreactnativecommunitywebviewRNCWebViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:ProjectsReact-NativeFUNAInode_modulesreact-native-webviewandroidsrcmainjavacomreactnativecommunitywebviewRNCWebViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-webview: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 1m 37s

at makeError (C:ProjectsReact-NativeFUNAInode_modulesexecaindex.js:174:9)
at Promise.all.then.arr (C:ProjectsReact-NativeFUNAInode_modulesexecaindex.js:278:16)
at process._tickCallback (internal/process/next_tick.js:68:7)

More From » android

 Answers
8

I also have the same issue when I installed WebView.


To fix it, you need to update your compileSdkVersion to 29. While you are at it, you might as well update the buildToolsVersion. You can do that by changing these lines in your project's /android/build.gradle file.


buildscript {
ext {

buildToolsVersion = "29.0.3"
compileSdkVersion = 29

}

}

[#3636] Thursday, May 28, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
pranavrorys

Total Points: 466
Total Questions: 87
Total Answers: 115

Location: Barbados
Member since Sun, Nov 27, 2022
2 Years ago
pranavrorys questions
Fri, May 27, 22, 00:00, 2 Years ago
Thu, Oct 28, 21, 00:00, 3 Years ago
Fri, Dec 20, 19, 00:00, 5 Years ago
Fri, Oct 11, 19, 00:00, 5 Years ago
;