Task :react-native-webview:compileDebugJavaWithJavac FAILED - javascript

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:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewModule.java:276: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
^
symbol: variable Q
location: class VERSION_CODES
Note: C:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.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:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewModule.java:276: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
^
symbol: variable Q
location: class VERSION_CODES
Note: C:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Projects\React-Native\FUNAI\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview\RNCWebViewManager.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:\Projects\React-Native\FUNAI\node_modules\execa\index.js:174:9)
at Promise.all.then.arr (C:\Projects\React-Native\FUNAI\node_modules\execa\index.js:278:16)
at process._tickCallback (internal/process/next_tick.js:68:7)

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
…
}
…
}

Related

i started work on my final year project on react native i face one error when i run this command "npm run android " then it show error

npm run andriod
Error
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.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\Sharjil\AwesomeProject\android\settings.gradle' (C:\Users\Sharjil.gradle\caches\7.5.1\scripts\9hquuo8ig26y11gv08ef208wj).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 63
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 2s

Execution failed for task ':app:mergeDebugNativeLibs'

After running my react native app i got this error
"FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
More than one file was found with OS independent path 'lib/x86/libc++_shared.so'
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 57s
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
warning: [options] source value 7 is obsolete and will be removed in a future release"
i tried gradlew clean but it dosent work...
please help

Package djinni has been ignored because it contains invalid configuration

I have djinni installed in my react native project.
I try to run my react native project, but i got this warning in my terminal
Package djinni has been ignored because it contains invalid configuration.
after that i got this error.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
24 actionable tasks: 2 executed, 22 up-to-date
error Failed to install the app. Make sure you have the Android development environment set
up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
Error while executing process /home/pandusudo/Android/Sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/pandusudo/Public/mobile-je/android/app/src/main/jni/Android.mk NDK_APPLICATION_MK=/home/pandusudo/Public/mobile-je/android/app/src/main/jni/Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=/home/pandusudo/Public/mobile-je/android/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/pandusudo/Public/mobile-je/android/app/build/intermediates/ndkBuild/debug/lib /home/pandusudo/Public/mobile-je/android/app/build/intermediates/ndkBuild/debug/obj/local/x86/libhelloworld.so}
[x86] SharedLibrary : libhelloworld.so
src/main/jni/../../../../../djinni/jni/NativeHelloWorld.cpp:26: error: undefined reference to 'helloworld::HelloWorld::create()'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/home/pandusudo/Android/Sdk/ndk-bundle/build/core/build-binary.mk:725: /home/pandusudo/Public/mobile-je/android/app/build/intermediates/ndkBuild/debug/obj/local/x86/libhelloworld.so] Error 1
* 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 8s

Reac-native running first time

I´m new in react-native and I´m trying run my first helloworld project.
But I´m getting this error
How could I solve this?
info Running jetifier to migrate libraries to AndroidX. You can
disable it using "--no-jetifier" flag. Jetifier found 863 file(s) to
forward-jetify. Using 4 workers... info Starting JS server... info
Installing the app...
FAILURE: Build failed with an exception.
What went wrong: Could not determine the dependencies of task ':app:preDebugBuild'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve org.webkit:android-jsc:+.
Required by:
project :app
Failed to list versions for org.webkit:android-jsc.
Unable to load Maven meta-data from https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml.
Could not get resource 'https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml'.
Could not GET 'https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml'.
Received status code 522 from server: Origin Connection Time-out
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 48s
error Failed to install the app. Make sure you have the Android
development environment set up:
https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment.
Run CLI with --verbose flag for more details. Error: Command failed:
gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong: Could not determine the dependencies of task ':app:preDebugBuild'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve org.webkit:android-jsc:+.
Required by:
project :app
Failed to list versions for org.webkit:android-jsc.
Unable to load Maven meta-data from https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml.
Could not get resource 'https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml'.
Could not GET 'https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml'.
Received status code 522 from server: Origin Connection Time-out
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 48s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\Users\amaro.manungu\AmaroProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\Users\amaro.manungu\AmaroProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\amaro.manungu\AmaroProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\Users\amaro.manungu\AmaroProject\node_modules\react-native\node_modules\#react-native-community\cli\build\cliEntry.js:160:7)
Change the following in android/build.gradle
maven { url 'https://jitpack.io' }
to
maven { url 'https://www.jitpack.io' }
Source: https://stackoverflow.com/a/52812651/1889732
build the project with offline mode.
you can toggle the offline mode button on in android studio.
if you build project use command line add --offline at the end of the gradle command.

React-native Failed to process resources, see aapt output above for details

I need help with my first React-native app.
It generates
C:\Users\Bradburry\Downloads\Project Vlogee\Hasura>react-native run-android
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Configure project :app
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
C:\Users\Bradburry.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\eaf5e02e0fb5007b45b00a347d77a822\res\values-v24\values-v24.xml:3:5-157: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
C:\Users\Bradburry.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\eaf5e02e0fb5007b45b00a347d77a822\res\values-v24\values-v24.xml:4:5-135: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
C:\Users\Bradburry.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\eaf5e02e0fb5007b45b00a347d77a822\res\values-v26\values-v26.xml:13:5-16:13: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
Failed to process resources, see aapt output above 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 32s
13 actionable tasks: 3 executed, 10 up-to-date
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

Categories

Resources