reactnative -PreactNativeDevServerPort=8081 android studio error - react-native

When i command npx react-native run-android,i get this error.Any solution?
> Task :react-native-community_netinfo:generateDebugRFile FAILED
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

Related

React Native İnstallation Error: Command failed: gradlew.bat app:installDebug

error Failed to install the app. Make sure you have an Android emulator running or a device connected.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: C:\Users\w10\Desktop\AwesomeProject\android\app\src\debug\java\com\awesomeproject\ReactNativeFlipper.java uses or overrides a deprecated API.

Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 (How to fix?)

Show this error whenever I run react-native run-android
react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1598 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...
FAILURE: Build failed with an exception.
What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
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 808ms
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
How to fix this?
Can you try to navigate in the android directory and run this command
chmod 755 android/gradlew
and then try to run the npm run-android command.

Problem encountered in installing react-native

This is a react-native installation issue:
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
C:\Users\eshas\AwesomeProject>react-native run-android
You need to install AndroidStudio and Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

Trouble linking libraries

I am trying to link this library called react-native-text-detector.
However, I consistently get an error saying Command failed: gradlew.bat installDebug
I have tried changing the '\' in settings.gradle to '/'. However, the same error still pops up
All I have been doing is this
react-native init textDetectorTesting
npm install --save react-native-text-detector
react-native link
This is the error I received
BUILD FAILED in 41s
42 actionable tasks: 42 executed
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
Command failed: gradlew.bat installDebug
Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:622:11)
at Object.execFileSync (child_process.js:640:13)
at runOnAllDevices (C:\Users\tanch\textdetector4\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (C:\Users\tanch\textdetector4\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (C:\Users\tanch\textdetector4\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process.internalTickCallback (internal/process/next_tick.js:77:7)

Error: Command failed: gradlew.bat installDebug on windows 8.1

I am creating the react-native app on windows 8.1 platform, while I am creating build using react-native run-android its giving me the following error. Please help me on the same.
Command failed: gradlew.bat installDebug
Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:611:11)
at Object.execFileSync (child_process.js:629:13)
at runOnAllDevices (E:\showTimes\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (E:\showTimes\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (E:\showTimes\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
create local.properties file in project root/android then add path to your SDK location
my case
sdk.dir = C:\\Users\\<userName>\\AppData\\Local\\Android\\sdk