React-native: can't compile and run my react native app

Created on 4 Aug 2019  ยท  27Comments  ยท  Source: facebook/react-native

I just can't compile and run my react native app, and I'm getting this message :

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\Users\me\ReactNative\MyApp\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 190

  • What went wrong:
    A problem occurred evaluating settings 'MyApp'.

    Unable to determine the current character, it is not a string, number, array, or object

    The current character read is 'E' with an int value of 69
    Unable to determine the current character, it is not a string, number, array, or object
    line number 1
    index number 0.

React Native version:

Steps To Reproduce

1.
2.

Describe what you expected to happen:

Snack, code example, screenshot, or link to a repository:

Bug

Most helpful comment

I finally found the solution, something I was quite sure about doing, but thanks to this this guy https://github.com/facebook/react-native/issues/24733#issuecomment-517921169 :I had to delete "app\build\intermediates\signing_config\debug\out\signing-config.json" and now it works.

All 27 comments

I finally found the solution, something I was quite sure about doing, but thanks to this this guy https://github.com/facebook/react-native/issues/24733#issuecomment-517921169 :I had to delete "app\build\intermediates\signing_config\debug\out\signing-config.json" and now it works.

thank bro!!!

thanks, you just saved my ass in the nick of a meeting

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.( i don't even have a build folder to delete ((: )
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
Memory: 2.20 GB / 7.95 GB
Binaries:
Node: 8.11.3 - C:\Program Files\nodejs\node.EXE
npm: 5.6.0 - C:\Program Files\nodejs\npm.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:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native\cli.js{ "root": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "reactNativePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-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:\Users\omidazm\Desktop\web\learning\react-native\green26\ios", "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "pbxprojPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj\project.pbxproj", "podfile": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\Podfile", "podspecPath": null, "projectPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj", "projectName": "green26.xcodeproj", "libraryFolder": "Libraries", "sharedLibraries": [], "plist": [], "scriptPhases": [] }, "android": { "sourceDir": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app", "isFlat": false, "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "stringsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\res\values\strings.xml", "manifestPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\AndroidManifest.xml", "buildGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\build.gradle", "settingsGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\settings.gradle", "assetsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\assets", "mainFilePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\java\com\green26\MainApplication.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:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native\cli.js{ "root": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "reactNativePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-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:\Users\omidazm\Desktop\web\learning\react-native\green26\ios", "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "pbxprojPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj\project.pbxproj", "podfile": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\Podfile", "podspecPath": null, "projectPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj", "projectName": "green26.xcodeproj", "libraryFolder": "Libraries", "sharedLibraries": [], "plist": [], "scriptPhases": [] }, "android": { "sourceDir": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app", "isFlat": false, "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "stringsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\res\values\strings.xml", "manifestPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\AndroidManifest.xml", "buildGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\build.gradle", "settingsGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\settings.gradle", "assetsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\assets", "mainFilePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\java\com\green26\MainApplication.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:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

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.( i don't even have a build folder to delete ((: )
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
Memory: 2.20 GB / 7.95 GB
Binaries:
Node: 8.11.3 - C:\Program Files\nodejs\node.EXE
npm: 5.6.0 - C:\Program Files\nodejs\npm.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.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
'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:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native\cli.js{ "root": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "reactNativePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-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:\Users\omidazm\Desktop\web\learning\react-native\green26\ios", "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "pbxprojPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj\project.pbxproj", "podfile": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\Podfile", "podspecPath": null, "projectPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj", "projectName": "green26.xcodeproj", "libraryFolder": "Libraries", "sharedLibraries": [], "plist": [], "scriptPhases": [] }, "android": { "sourceDir": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app", "isFlat": false, "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "stringsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\srcmain\res\values\strings.xml", "manifestPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\srcmainAndroidManifest.xml", "buildGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\build.gradle", "settingsGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\settings.gradle", "assetsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\srcmain\assets", "mainFilePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\srcmain\java\com\green26\MainApplication.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:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native\cli.js{ "root": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "reactNativePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-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:\Users\omidazm\Desktop\web\learning\react-native\green26\ios", "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "pbxprojPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj\project.pbxproj", "podfile": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\Podfile", "podspecPath": null, "projectPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj", "projectName": "green26.xcodeproj", "libraryFolder": "Libraries", "sharedLibraries": [], "plist": [], "scriptPhases": [] }, "android": { "sourceDir": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app", "isFlat": false, "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "stringsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\srcmain\res\values\strings.xml", "manifestPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\srcmainAndroidManifest.xml", "buildGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\build.gradle", "settingsGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\settings.gradle", "assetsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\srcmain\assets", "mainFilePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\srcmain\java\com\green26\MainApplication.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:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

same problem here i just ran the react-native run-android after i init the project

I had the same problem, too and I have a fix that works for me.
The line where native_modules.gradle fails is in line 182 of @omidazm94 s native_modules.gradle:
def json = new JsonSlurper().parseText(reactNativeConfigOutput)
reactNativeConfigOutput is the output of command
npx --quiet react-native config
And the output of that contains a path in its first line, in this case it was:
C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native\cli.js.
So if you remove that from the reactNativeConfigOutput in your native_modules.gradle
def json = new JsonSlurper().parseText(reactNativeConfigOutput - "C:\\Users\\omidazm\\Desktop\\web\\learning\\react-native\\green26\\node_modules\\react-native\\cli.js")
everything should work.

This is obviously a nasty workaround, but at least it worked for me.

thank you @michivo
this is probably a better solution. but i found that problem is nodejs and i used solution below and it worked for me. but thanks anyway
(Solution for windows platform
Uninstall Node
Delete folder from programfiles if exist (C:\Program Files\nodejs)
Delete npm's data folder: C:\Users{Your uername}\AppData\Roaming\nmp
Install node Again(use different installation folder like "C:\Program Files\nodejs-2")
Root cause is node and nvm installed in same installation folder.)

@omidazm94 @michivo i have same problem but your solutions not works for me

I had the same problem, too and I have a fix that works for me.
The line where native_modules.gradle fails is in line 182 of @omidazm94 s native_modules.gradle:
def json = new JsonSlurper().parseText(reactNativeConfigOutput)
reactNativeConfigOutput is the output of command
npx --quiet react-native config
And the output of that contains a path in its first line, in this case it was:
C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native\cli.js.
So if you remove that from the reactNativeConfigOutput in your native_modules.gradle
def json = new JsonSlurper().parseText(reactNativeConfigOutput - "C:\\Users\\omidazm\\Desktop\\web\\learning\\react-native\\green26\\node_modules\\react-native\\cli.js")
everything should work.

This is obviously a nasty workaround, but at least it worked for me.

where i have to run that command npx --quiet react-native config
is it in the root of the project or some where else

This is a hack but it worked for me, thanks to @michivo

Do this at line 182 of your native_modules.gradle:

This is what you have:
def json = new JsonSlurper().parseText(reactNativeConfigOutput )

Replace (reactNativeConfigOutput) with (reactNativeConfigOutput - )

As in:
def json = new JsonSlurper().parseText(reactNativeConfigOutput - "C:\\Users\\EMEKA\\Projects\\Mobile\\ReactNative\\livestream\\node_modules\\react-native\\cli.js")

where "C:\\Users\\EMEKA\\Projects\\Mobile\\ReactNative\\livestream\\node_modules\\react-native\\cli.js"is my

thank you @michivo
this is probably a better solution. but i found that problem is nodejs and i used solution below and it worked for me. but thanks anyway
(Solution for windows platform
Uninstall Node
Delete folder from programfiles if exist (C:\Program Files\nodejs)
Delete npm's data folder: C:\Users{Your uername}\AppData\Roaming\nmp
Install node Again(use different installation folder like "C:\Program Files\nodejs-2")
Root cause is node and nvm installed in same installation folder.)

I have the same problem.
I upgrade the nodejs from 8.x.x to 10.x.x incorrectly yesterday. I'm not sure it's a problem caused by node. Anyway, I reinstall my nodejs, then it worked.
Thank you @omidazm94

In my case, something is wrong with my AndroidManifest.xml file,
it should be <activity>...</activity>
but I write it as <activity/>...</activity>

Just wanna comment saying I'm using react native for the first time today, and following the install instructions having used ReactJS before, and I'm having the same thing. Tried @michivo's hack and uninstalled, changed, downgraded etc Node's install. Been at this for like 6 hours. Hope someone figures it out so I can finally switch from Flutter lol

I tried this.
https://github.com/facebook/react-native/issues/26945#issuecomment-549381164.

It worked for me.

I finally found the solution, something I was quite sure about doing, but thanks to this this guy #24733 (comment) :I had to delete "app\build\intermediates\signing_config\debug\out\signing-config.json" and now it works.

Thanks its working for me.

Folks these all seem like major hacks this stuff should work out of the box and puts serious doubts about react-native being fit for use...that being said I would suggest you check your permissions (assuming people are on Windows 10 like myself) - I found 90% of these issues were caused by VS Code not being started in admin mode, Windows Command consoles not using elevated permissions etc.

@

Folks these all seem like major hacks this stuff should work out of the box and puts serious doubts about react-native being fit for use...that being said I would suggest you check your permissions (assuming people are on Windows 10 like myself) - I found 90% of these issues were caused by VS Code not being started in admin mode, Windows Command consoles not using elevated permissions etc.

I agree, I switched back to Flutter even after finally getting it working, and I always have VSCode, consoles in admin mode by default.

Try updating the Node to the version 10.17.0. It helped me.

I updated NodeJs to v12.14.1 then it worked!!

I my case, I had error in manifest.xml, I had an errant <activity />

I had the same problem, too and I have a fix that works for me.
The line where native_modules.gradle fails is in line 182 of @omidazm94 s native_modules.gradle:
def json = new JsonSlurper().parseText(reactNativeConfigOutput)
reactNativeConfigOutput is the output of command
npx --quiet react-native config
And the output of that contains a path in its first line, in this case it was:
C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native\cli.js.
So if you remove that from the reactNativeConfigOutput in your native_modules.gradle
def json = new JsonSlurper().parseText(reactNativeConfigOutput - "C:\\Users\\omidazm\\Desktop\\web\\learning\\react-native\\green26\\node_modules\\react-native\\cli.js")
everything should work.

This is obviously a nasty workaround, but at least it worked for me.

This is exactly my situation!
Something wrong with npx

I am having this problem too. Literally nothing changed since my last successful build. So far my experience with React Native has been a whack-a-mole of fixing random issues that come out of no where for no apparent reason. The errors never do a decent job at telling me what is wrong. I just end up googling until I find random solutions like this. I don't know how anyone could build an App like this. It makes me feel like maybe I'm missing something

I finally found the solution, something I was quite sure about doing, but thanks to this this guy #24733 (comment) :I had to delete "app\build\intermediates\signing_config\debug\out\signing-config.json" and now it works.

It works for me !! Thanks ๐Ÿ˜ƒ๐Ÿ˜ƒ๐Ÿ˜ƒ๐Ÿ˜ƒ

I just can't compile and run my react native app, and I'm getting this message :

FAILURE: Build failed with an exception.

* Where:
  Script 'C:\Users\me\ReactNative\MyApp\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 190

* What went wrong:
  A problem occurred evaluating settings 'MyApp'.

Unable to determine the current character, it is not a string, number, array, or object

The current character read is 'E' with an int value of 69
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0.

React Native version:

Steps To Reproduce

Describe what you expected to happen:

Snack, code example, screenshot, or link to a repository:

What definitely worked for me was add a file local.properties inside android folder with content sdk.dir = /home/{USER}/Android/Sdk and use react-native cli instead of @react-native-communuty/cli

Running Terminal as Administrator in Windows did the trick for me... Other solutions did not work.

In my case, something is wrong with my AndroidManifest.xml file

@fxbayuanggara's https://github.com/facebook/react-native/issues/25936#issuecomment-549749991 was the solution for me.

Check your AndroidManifest.xml for invalid xml or other bad stuff!

In my case, something is wrong with my AndroidManifest.xml file,
it should be
but I write it as

@fxbayuanggara Thank you for finding this kind of missings

Was this page helpful?
0 / 5 - 0 ratings