Getting error while executing run-android with react-native - react-native

my english isn't that good. I am from Turkey and sorry if my question isn't clear to you.
When I run run-android with React Native, I get the following error but when I run run-ios I don't get any issue. I am using a Mac computer.
Thank you for your help.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1063 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: spawn EPERM
at ChildProcess.spawn (internal/child_process.js:407:11)
at Object.spawn (child_process.js:548:9)
at module.exports (/Users/meric/Desktop/Phonder/node_modules/execa/index.js:205:26)
at runOnAllDevices (/Users/meric/Desktop/Phonder/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:32)
at buildAndRun (/Users/meric/Desktop/Phonder/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:182:41)
at /Users/meric/Desktop/Phonder/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:146:12
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Command.handleAction (/Users/meric/Desktop/Phonder/node_modules/react-native/node_modules/#react-native-community/cli/build/index.js:186:9)
enter image description here

I think you should uninstall the app on any emulator or devices, after that please re-run app.

It might be caused by having package.lock.json and yarn.lock at the same time

Related

React Native Application error at installing npx bugsnag

Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:464:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Hello,
Anas Ahmed here, I was installing bugsnag-expo-cli-init in my react native app at first it asked me 3 ques and then at the time of installing it gave me this error can anyone help me in this. Installing in npm
Are you attempting to run the bugsnag-expo-cli on Windows? Bugsnag's Expo CLI currently only supports Linux and Mac:
https://docs.bugsnag.com/platforms/react-native/expo/#installation-and-configuration
As an alternative to the CLI, you could follow the manual integration guide:
https://docs.bugsnag.com/platforms/react-native/expo/manual-setup/

React Native - No such file or directory, open 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml'

I am using React Native 0.61.5, after installing #react-native-community/cli and running react-native run-android this issue appeared:
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...
error ENOENT: no such file or directory, open 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml'. Run CLI with --verbose flag for more details.
Error: ENOENT: no such file or directory, open 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml'
at Object.openSync (fs.js:440:3)
at Object.readFileSync (fs.js:342:35)
at getLaunchPackageName (C:\Users\Gabriel\Desktop\testeProjeto\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\getLaunchPackageName.js:161:33)
at buildAndRun (C:\Users\Gabriel\Desktop\testeProjeto\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:163:63)
at C:\Users\Gabriel\Desktop\testeProjeto\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:135:12
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async Command.handleAction (C:\Users\Gabriel\Desktop\testeProjeto\node_modules\#react-native-community\cli\build\index.js:182:9)
As this answer says:
There seems to be an issue with the latest version of #react-native-community/cli-platform-android 3.1.1.
I have resolved my issue by downgrading to an older version of the library by adding this to my package.json.
"resolutions": {
"#react-native-community/cli-platform-android": "2.9.0"
}
After that, remove the node_modules folder and run yarn or npm install again.

I could not run my react-native project due to java installation

////
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.

Hi guys I keep getting the error ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH

I keep getting
ERROR: JAVA_HOME is not set and no 'java' command could be found in
your PATH
Whenever I try to run react-native code from my terminal to use an android emulator.
I've recently been trying to set up react-native on my laptop through wsl because the virtual box has been giving me trouble using it.
I've set my ANDROID_PATH to C:\Users\username\AppData\Local\Android\Sdk and my JAVA_PATH to D:\Program Files\Java\jdk-13.0.1. But I keep getting the error.
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 8 workers... info Starting JS server... /bin/sh:
1: adb: not found 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 not set and no 'java' command could be found in
your PATH. 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-started.html#android-development-environment.
Run CLI with --verbose flag for more details. Error: Command failed:
./gradlew app:installDebug -PreactNativeDevServerPort=8081
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (/mnt/c/users/meron/Projects/react/New_project_7/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
I've tried everything but still no luck

Problem encountered in react native run android

I recently installed React Native on my Windows PC and I created a project but when i try with react-native run-android for android emulator it shows me:
C:\ReactNative\testproj>react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 855 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files (x86)\Java
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-started.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:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (C:\ReactNative\testproj\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\ReactNative\testproj\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at then.result (C:\ReactNative\testproj\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
Please help
Your JAVA_HOME is set incorrectly, go through the setup again, everything should works...
You can refer to this and check what is missing...