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
Related
When I run "npx react-native run-android" it shows the follow message:
info JS server already running.
O sistema n�o pode encontrar o caminho especificado.
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
ERROR: JAVA_HOME is set to an invalid directory: C:\Users\PABLO\AppData\Local\Android\Sdk
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
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
at makeError (C:\Users\PABLO\teste7\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\PABLO\teste7\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\PABLO\teste7\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
at async Command.handleAction (C:\Users\PABLO\teste7\node_modules\#react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.
I really do not know what to do to run my android emulator, once I installed conform setting up development the documentation.
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
////
I set jdk path in environment variables.
But the app could not be installed.
I have tried many times.
But the bugs are still there.do reply if there is any solution.
D:\React Project\MyApp>react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-
jetifier"
flag.
Jetifier found 864 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_66\bin
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
error Failed to install the app. Make sure you have the Android development environment set up:
https://facebook.github.io/react-native/docs/getting-starte
d.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (D:\React Project\MyApp\node_modules\#react-native-community\cli-platform-
android\build\commands\runAndroid\runOnAllDevices.js:94:39
)
at buildAndRun (D:\React Project\MyApp\node_modules\#react-native-community\cli-platform-
android\build\commands\runAndroid\index.js:158:41)
at D:\React Project\MyApp\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 (D:\React Project\MyApp\node_modules\react-
native\node_modules\#react-
native-community\cli\build\index.js:164:9)
///
Set your JAVA_HOME like This:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_66
/bin is not required.
Checkout this answer for more references.
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)
Whenever I create new project in react native it works fine and runs on android device but when I install "React Navigation 3.x" library in my react native app and try to build it on my device I got the following error
Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:622:11)
at Object.execFileSync (child_process.js:640:13)
at runOnAllDevices (E:\ReactNative\awesomeproject\node_modules\react-
local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (E:\ReactNative\awesomeproject\node_modules\react-nati
l-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (E:\ReactNative\awesomeproject\node_
\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
Go inside your android directory and use this ./gradlew clean, after this you will see an error about you are missing the sdk path. Inside the android directory create a new file local.properties and write down there the sdk path, Windows: sdk.dir=C\:\\Users\\YOU_USERNAME\\AppData\\Local\\Android\\sdk the same thing for MAC with a different path (check the path with android studio)