hi, i'm facing this problem and its weird cause it happened when i created a new project with react-native init two days ago. i can run the old project but when i try to use command react-native run-android in the new project it gives me an error. and from the last few days every project that i build have a problem even if i build with Previous react-native versions, something comes like warnOnce and so on. is it something new that changed in react and react-native that cause these problems ?
please help me
https://github.com/facebook/react-native/issues/25936
(react-native info)
React Native version:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
Memory: 4.21 GB / 7.95 GB
Binaries:
Node: 8.11.3 - C:Program Filesnodejsnode.EXE
npm: 5.6.0 - C:Program Filesnodejsnpm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
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...
'C:Program' is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator...
'C:Program' is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Emulator exited before boot..
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.
Where:
Script 'C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 182
What went wrong:
A problem occurred evaluating script.
Unable to determine the current character, it is not a string, number, array, or object
The current character read is 'C' with an int value of 67
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
C:UsersomidazmDesktopweblearningreact-nativegreen26node_modulesreact-nativecli.js{ "root": "C:UsersomidazmDesktopweblearningreact-nativegreen26", "reactNativePath": "C:UsersomidazmDesktopweblearningreact-nativegreen26node_modulesreact-native", "dependencies": {}, "commands": [ { "name": "log-ios", "description": "starts iOS device syslog tail" }, { "name": "run-ios", "description": "builds your app and starts it on iOS simulator", "examples": [ { "desc": "Run on a different simulator, e.g. iPhone 5", "cmd": "react-native run-ios --simulator "iPhone 5"" }, { "desc": "Pass a non-standard location of iOS directory", "cmd": "react-native run-ios --project-path "./app/ios"" }, { "desc": "Run on a connected device, e.g. Max's iPhone", "cmd": "react-native run-ios --device "Max's iPhone"" }, { "desc": "Run on the AppleTV simulator", "cmd": "react-native run-ios --simulator "Apple TV" --scheme "helloworld-tvOS"" } ], "options": [ { "name": "--simulator [string]", "description": "Explicitly set simulator to use. Optionally include iOS version betweenparenthesis at the end to match an exact version: "iPhone 6 (10.0)"", "default": "iPhone 11" }, { "name": "--configuration [string]", "description": "Explicitly set the scheme configuration to use", "default": "Debug" }, { "name": "--scheme [string]", "description": "Explicitly set Xcode scheme to use" }, { "name": "--project-path [string]", "description": "Path relative to project root where the Xcode project (.xcodeproj) lives.", "default": "ios" }, { "name": "--device [string]", "description": "Explicitly set device to use by name. The value is not required if you have a single device connected." }, { "name": "--udid [string]", "description": "Explicitly set device to use by udid" }, { "name": "--no-packager", "description": "Do not launch packager while building" }, { "name": "--verbose", "description": "Do not use xcpretty even if installed" }, { "name": "--port [number]", "default": 8081 }, { "name": "--terminal [string]", "description": "Launches the Metro Bundler in a new window using the specified terminal path." } ] }, { "name": "log-android", "description": "starts logkitty" }, { "name": "run-android", "description": "builds your app and starts it on a connected Android emulator or device", "options": [ { "name": "--root [string]", "description": "Override the root directory for the android build (which contains the android directory)", "default": "" }, { "name": "--variant [string]", "description": "Specify your app's build variant", "default": "debug" }, { "name": "--appFolder [string]", "description": "Specify a different application folder name for the android source. If not, we assume is "app"", "default": "app" }, { "name": "--appId [string]", "description": "Specify an applicationId to launch after build.", "default": "" }, { "name": "--appIdSuffix [string]", "description": "Specify an applicationIdSuffix to launch after build.", "default": "" }, { "name": "--main-activity [string]", "description": "Name of the activity to start", "default": "MainActivity" }, { "name": "--deviceId [string]", "description": "builds your app and starts it on a specific device/simulator with the given device id (listed by running "adb devices" on the command line)." }, { "name": "--no-packager", "description": "Do not launch packager while building" }, { "name": "--port [number]", "default": 8081 }, { "name": "--terminal [string]", "description": "Launches the Metro Bundler in a new window using the specified terminal path." }, { "name": "--tasks [list]", "description": "Run custom Gradle tasks. By default it's "installDebug"" }, { "name": "--no-jetifier", "description": "Do not run "jetifier" – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier.", "default": false } ] } ], "assets": [], "platforms": { "ios": {}, "android": {} }, "haste": { "providesModuleNodeModules": [ "react-native" ], "platforms": [ "ios", "android" ] }, "project": { "ios": { "sourceDir": "C:UsersomidazmDesktopweblearningreact-nativegreen26ios", "folder": "C:UsersomidazmDesktopweblearningreact-nativegreen26", "pbxprojPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26iosgreen26.xcodeprojproject.pbxproj", "podfile": "C:UsersomidazmDesktopweblearningreact-nativegreen26iosPodfile", "podspecPath": null, "projectPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26iosgreen26.xcodeproj", "projectName": "green26.xcodeproj", "libraryFolder": "Libraries", "sharedLibraries": [], "plist": [], "scriptPhases": [] }, "android": { "sourceDir": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidapp", "isFlat": false, "folder": "C:UsersomidazmDesktopweblearningreact-nativegreen26", "stringsPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainresvaluesstrings.xml", "manifestPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainAndroidManifest.xml", "buildGradlePath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappbuild.gradle", "settingsGradlePath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidsettings.gradle", "assetsPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainassets", "mainFilePath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainjavacomgreen26MainApplication.java", "packageName": "com.green26" } }}
^
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 23s
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.
Where:
Script 'C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 182
What went wrong:
A problem occurred evaluating script.
Unable to determine the current character, it is not a string, number, array, or object
The current character read is 'C' with an int value of 67
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
C:UsersomidazmDesktopweblearningreact-nativegreen26node_modulesreact-nativecli.js{ "root": "C:UsersomidazmDesktopweblearningreact-nativegreen26", "reactNativePath": "C:UsersomidazmDesktopweblearningreact-nativegreen26node_modulesreact-native", "dependencies": {}, "commands": [ { "name": "log-ios", "description": "starts iOS device syslog tail" }, { "name": "run-ios", "description": "builds your app and starts it on iOS simulator", "examples": [ { "desc": "Run on a different simulator, e.g. iPhone 5", "cmd": "react-native run-ios --simulator "iPhone 5"" }, { "desc": "Pass a non-standard location of iOS directory", "cmd": "react-native run-ios --project-path "./app/ios"" }, { "desc": "Run on a connected device, e.g. Max's iPhone", "cmd": "react-native run-ios --device "Max's iPhone"" }, { "desc": "Run on the AppleTV simulator", "cmd": "react-native run-ios --simulator "Apple TV" --scheme "helloworld-tvOS"" } ], "options": [ { "name": "--simulator [string]", "description": "Explicitly set simulator to use. Optionally include iOS version betweenparenthesis at the end to match an exact version: "iPhone 6 (10.0)"", "default": "iPhone 11" }, { "name": "--configuration [string]", "description": "Explicitly set the scheme configuration to use", "default": "Debug" }, { "name": "--scheme [string]", "description": "Explicitly set Xcode scheme to use" }, { "name": "--project-path [string]", "description": "Path relative to project root where the Xcode project (.xcodeproj) lives.", "default": "ios" }, { "name": "--device [string]", "description": "Explicitly set device to use by name. The value is not required if you have a single device connected." }, { "name": "--udid [string]", "description": "Explicitly set device to use by udid" }, { "name": "--no-packager", "description": "Do not launch packager while building" }, { "name": "--verbose", "description": "Do not use xcpretty even if installed" }, { "name": "--port [number]", "default": 8081 }, { "name": "--terminal [string]", "description": "Launches the Metro Bundler in a new window using the specified terminal path." } ] }, { "name": "log-android", "description": "starts logkitty" }, { "name": "run-android", "description": "builds your app and starts it on a connected Android emulator or device", "options": [ { "name": "--root [string]", "description": "Override the root directory for the android build (which contains the android directory)", "default": "" }, { "name": "--variant [string]", "description": "Specify your app's build variant", "default": "debug" }, { "name": "--appFolder [string]", "description": "Specify a different application folder name for the android source. If not, we assume is "app"", "default": "app" }, { "name": "--appId [string]", "description": "Specify an applicationId to launch after build.", "default": "" }, { "name": "--appIdSuffix [string]", "description": "Specify an applicationIdSuffix to launch after build.", "default": "" }, { "name": "--main-activity [string]", "description": "Name of the activity to start", "default": "MainActivity" }, { "name": "--deviceId [string]", "description": "builds your app and starts it on a specific device/simulator with the given device id (listed by running "adb devices" on the command line)." }, { "name": "--no-packager", "description": "Do not launch packager while building" }, { "name": "--port [number]", "default": 8081 }, { "name": "--terminal [string]", "description": "Launches the Metro Bundler in a new window using the specified terminal path." }, { "name": "--tasks [list]", "description": "Run custom Gradle tasks. By default it's "installDebug"" }, { "name": "--no-jetifier", "description": "Do not run "jetifier" – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier.", "default": false } ] } ], "assets": [], "platforms": { "ios": {}, "android": {} }, "haste": { "providesModuleNodeModules": [ "react-native" ], "platforms": [ "ios", "android" ] }, "project": { "ios": { "sourceDir": "C:UsersomidazmDesktopweblearningreact-nativegreen26ios", "folder": "C:UsersomidazmDesktopweblearningreact-nativegreen26", "pbxprojPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26iosgreen26.xcodeprojproject.pbxproj", "podfile": "C:UsersomidazmDesktopweblearningreact-nativegreen26iosPodfile", "podspecPath": null, "projectPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26iosgreen26.xcodeproj", "projectName": "green26.xcodeproj", "libraryFolder": "Libraries", "sharedLibraries": [], "plist": [], "scriptPhases": [] }, "android": { "sourceDir": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidapp", "isFlat": false, "folder": "C:UsersomidazmDesktopweblearningreact-nativegreen26", "stringsPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainresvaluesstrings.xml", "manifestPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainAndroidManifest.xml", "buildGradlePath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappbuild.gradle", "settingsGradlePath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidsettings.gradle", "assetsPath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainassets", "mainFilePath": "C:UsersomidazmDesktopweblearningreact-nativegreen26androidappsrcmainjavacomgreen26MainApplication.java", "packageName": "com.green26" } }}
^
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 23s
at checkExecSyncError (child_process.js:601:13)
at execFileSync (child_process.js:621:13)
at runOnAllDevices (C:UsersomidazmDesktopweblearningreact-nativegreen26node_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidrunOnAllDevices.js:94:39)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
1.react-native init project_name
2.react-native run-android
Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?
👉 Click here if you want to take another look at the Bug Report issue template.
Can you run react-native info and edit your issue to include these results under the React Native version: section?
[skip envinfo] alongside an explanation in your Environment: section.
After some testing i was able to reproduce the Issue. The problem is your Node version is outdated. The requirement for React-Native is version 8.3 or newer. If you Update everything should be fine. But be careful because of this #26598 issue. The LTS version 10.16.3 should work fine.
After some testing i was able to reproduce the Issue. The problem is your Node version is outdated. The requirement for React-Native is version 8.3 or newer. If you Update everything should be fine. But be careful because of this #26598 issue. The LTS version 10.16.3 should work fine.
I had this problem and updating node to v12.13.0 LTS solved error.
After some testing i was able to reproduce the Issue. The problem is your Node version is outdated. The requirement for React-Native is version 8.3 or newer. If you Update everything should be fine. But be careful because of this #26598 issue. The LTS version 10.16.3 should work fine.
I had this problem and updating node to v12.13.0 LTS solved error.
As @NyauIf mentioned, v12.13.0 LTS causes this error#26598.
Latest working version of node is v12.10.0
thank you for your answers. problem was nodejs and i tried to update node and i get "can't read property 'resolve'" error. so i used this page and fixed it.
https://stackoverflow.com/questions/50597159/npm-err-asyncwrite-is-not-a-function/53985680#53985680
(Solution for windows platform
Uninstall Node
Delete folder from programfiles if exist (C:Program Filesnodejs)
Delete npm's data folder: C:Users{Your uername}AppDataRoamingnmp
Install node Again(use different installation folder like "C:Program Filesnodejs-2")
Root cause is node and nvm installed in same installation folder.)
now i can use react-native latest version :-))
React Native Sucks
I am unable to ran even a simple project
Worst Technology i have ever used..
Getting same error .
please help ,
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 4 workers...info JS server already running.
'C:UsersShahbaz' is not recognized as an internal or external
command,
operable program or batch file.
info Launching emulator...
'C:UsersShahbaz' is not recognized as an internal or external
command,
operable program or batch file.
'C:UsersShahbaz' is not recognized as an internal or external
command,
operable program or batch file.
error Failed to launch emulator. Reason: Emulator exited before
boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
The system cannot find the path specified.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
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
The system cannot find the path specified.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (E:\study & work\Work Space\React Native Work\Test\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at process._tickCallback (internal/process/next_tick.js:68:7)
Hi @shahbazhaider, yes your problem looks similar. Older NodeJs versions apparently have Problems with spaces in the path. Are you able to provide your NodeJs version with node -v ? You should have a version newer then NodeJs v8.3. The NodeJs v10.15.2 should work fine. But be Careful with your version because of this #26598 issue. If the Problem also occurs on the NodeJs v10.15.2 feel free to text me.
Hi Team,
I have updated my node to 10.17.0. Still i'm facing the error.
npx react-native info
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
Memory: 7.89 GB / 15.91 GB
Binaries:
Node: 10.17.0 - C:Program Filesnodejsnode.EXE
npm: 6.11.3 - C:Program Filesnodejsnpm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5977832
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.4 => 0.61.4
Error

heloo bro same problem facing ...space in folder path
please close this, this has nothing to do with react native
You did not follow the instructions at https://reactnative.dev/docs/environment-setup and did not install correct node version
Even if you did follow correct instructions, you stll had to open the issue in nodejs repository and not facebook/react-native

I have a error
please help me
info Starting JS server...
The system cannot find the path specified.
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...
Downloading https://services.gradle.org/distributions/gradle-6.2-all.zip
Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Request blocked by Privoxy"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at org.gradle.wrapper.Download.downloadInternal(Download.java:78)
at org.gradle.wrapper.Download.download(Download.java:63)
at org.gradle.wrapper.Install$1.call(Install.java:68)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
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
Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Request blocked by Privoxy"
This is not fixable by using a specific Node Version, I'm going to try move my Node install to a path without a space.
$ node -v
v14.15.0
Yeah, that did it, thank you @omidazm94
Most helpful comment
thank you for your answers. problem was nodejs and i tried to update node and i get "can't read property 'resolve'" error. so i used this page and fixed it.
https://stackoverflow.com/questions/50597159/npm-err-asyncwrite-is-not-a-function/53985680#53985680
(Solution for windows platform
Uninstall Node
Delete folder from programfiles if exist (C:Program Filesnodejs)
Delete npm's data folder: C:Users{Your uername}AppDataRoamingnmp
Install node Again(use different installation folder like "C:Program Filesnodejs-2")
Root cause is node and nvm installed in same installation folder.)
now i can use react-native latest version :-))