My React-Native application cannot start in emulator - react-native

My React-Native application cannot start in emulator.
help please!
c:\src\a1>npx react-native run-android
warn Package some-unsupported-package has been ignored because it contains invalid configuration. Reason: Cannot find module 'some-unsupported-package\package.json'
Require stack:
- c:\src\a1\node_modules\react-native\node_modules#react-native-community\cli\build\tools\config\resolveNodeModuleDir.js
- c:\src\a1\node_modules\react-native\node_modules#react-native-community\cli\build\tools\releaseChecker\index.js
- c:\src\a1\node_modules\react-native\node_modules#react-native-community\cli\build\commands\server\runServer.js
- c:\src\a1\node_modules\react-native\node_modules#react-native-community\cli\build\commands\server\server.js
- c:\src\a1\node_modules\react-native\node_modules#react-native-community\cli\build\commands\index.js
- c:\src\a1\node_modules\react-native\node_modules#react-native-community\cli\build\index.js
- c:\src\a1\node_modules\react-native\cli.js
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink " and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1010 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
* daemon not running; starting now at tcp:5037
* daemon started successfully
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Task :app:generateDebugBuildConfig FAILED
18 actionable tasks: 2 executed, 16 up-to-date
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
org.xml.sax.SAXParseException; systemId: file:/C:/src/a1/android/app/src/main/AndroidManifest.xml; lineNumber: 9; columnNumber: 40; The prefix "tools" for attribute "tools:node" associated with an element type "uses-permission" is not bound.
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
BU�LD FAILED in 35s
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:
Execution failed for task ':app:generateDebugBuildConfig'.
org.xml.sax.SAXParseException; systemId: file:/C:/src/a1/android/app/src/main/AndroidManifest.xml; lineNumber: 9; columnNumber: 40; The prefix "tools" for attribute "tools:node" associated with an element type "uses-permission" is not bound.
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 35s
at checkExecSyncError (child_process.js:630:11)
at execFileSync (child_process.js:648:15)
at runOnAllDevices (c:\src\a1\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Command.handleAction (c:\src\a1\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:182:9)

Related

pls am using linux mint , we ever i tried to run react native app , it gives me this error

Pls if anyone have a solution to why i can't run react native app on linux mint 20.3
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...
debug Running command "cd android && ./gradlew app:installDebug -PreactNativeDevServerPort=8081"
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module #197a83d6
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 7s
at makeError (/home/habibu/Documents/Dev/React_Native_Dev/Test_Dev/AwesomeProject/node_modules/execa/index.js:174:9)
at /home/habibu/Documents/Dev/React_Native_Dev/Test_Dev/AwesomeProject/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/home/habibu/Documents/Dev/React_Native_Dev/Test_Dev/AwesomeProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/home/habibu/Documents/Dev/React_Native_Dev/Test_Dev/AwesomeProject/node_modules/#react-native-community/cli/build/index.js:192:9)

I Can't running for android development react native, but it no problem on ios development, I'm using mac M1 Chip

I've done everything according to the documentation instructions but I'm having problems running for android, please help, its been 1 day I'm tray to fixed this, this the error message in my console,
thank you all
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 JS server already running.
info Installing the app...
> Task :app:processDebugMainManifest FAILED
11 actionable tasks: 2 executed, 9 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module #3376ca5d
* 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
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 app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module #3376ca5d
* 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
at makeError (/Users/riswangp/Documents/AwesomeProject/node_modules/execa/index.js:174:9)
at /Users/riswangp/Documents/AwesomeProject/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/riswangp/Documents/AwesomeProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/riswangp/Documents/AwesomeProject/node_modules/#react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
enter image description here
this screenshot the errors

Facing this issue when I try to run app on my mobile device

[C:\Users\Riaz\AwesomeProject>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 896 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
Task :app:compileDebugJavaWithJavac
Task :app:compileDebugJavaWithJavac FAILED
15 actionable tasks: 2 executed, 13 up-to-date
Note: C:\Users\Riaz\AwesomeProject\android\app\src\debug\java\com\awesomeproject\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module #0x1741397c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module #0x1741397c
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 19s
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
Note: C:\Users\Riaz\AwesomeProject\android\app\src\debug\java\com\awesomeproject\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module #0x1741397c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module #0x1741397c
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 19s
at makeError (C:\Users\Riaz\AwesomeProject\node_modules\execa\index.js:174:9)
at C:\Users\Riaz\AwesomeProject\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOnAllDevices (C:\Users\Riaz\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\Riaz\AwesomeProject\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.]1
Try replacing
"script":{
"start": "react-native run-android"
}
with
"script":{
"start": "npx jetify && cd android && ./gradlew clean && cd .. && react-native run-android"
}
in package.json
then run
npm run start
or
yarn start

How to fix the react-native-cli Failed to install the app error?

When i run the react-native run-android i face this error.
I tried to downgrade my java version to 8 but still not working.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 960 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...
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
FAILURE: Build failed with an exception.
* What went wrong:
Task 'installDebug' not found in project ':app'.
* Try:
Run gradlew tasks to get a list of available tasks. 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 3s
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
FAILURE: Build failed with an exception.
* What went wrong:
Task 'installDebug' not found in project ':app'.
* Try:
Run gradlew tasks to get a list of available tasks. 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 3s
at makeError (D:\freelance\SuperDaily\node_modules\execa\index.js:174:9)
at D:\freelance\SuperDaily\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async runOnAllDevices (D:\freelance\SuperDaily\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (D:\freelance\SuperDaily\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
I too got a similar error with this("node_modules/execa/index.js") file.
I resolved my error using the 2 commands given below
npm uninstall -g react-native-cli
yarn global add #react-native-community/cli
If my solution doesn't work then check some other solutions here
react-native run-android --variant Huaweidebug
Run with above command.
it should fixed but in case error exists then open project in android studio

react-native run-android i have isssu how to solve?

C:\Users\Sumithra K\Desktop\s\AwesomeProject>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 960 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
'C:\Users\Sumithra' is not recognized as an internal or external command,
operable program or batch file.
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...
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 16s
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
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 16s
at makeError (C:\Users\Sumithra K\Desktop\s\AwesomeProject\node_modules\execa\index.js:174:9)
at C:\Users\Sumithra K\Desktop\s\AwesomeProject\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\Sumithra K\Desktop\s\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\Sumithra K\Desktop\s\AwesomeProject\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
C:\Users\Sumithra K\Desktop\s\AwesomeProject>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 960 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
'C:\Users\Sumithra' is not recognized as an internal or external command,
operable program or batch file.
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...
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 2s
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
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 2s
at makeError (C:\Users\Sumithra K\Desktop\s\AwesomeProject\node_modules\execa\index.js:174:9)
at C:\Users\Sumithra K\Desktop\s\AwesomeProject\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\Sumithra K\Desktop\s\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\Sumithra K\Desktop\s\AwesomeProject\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
It says there is no emulator running to launch the application.
use adb devices command to see if there is any emulator or mobile devices attached.
Let me know if you still need help.