Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't compile and run my react native app #25936

Closed
icoboo opened this issue Aug 4, 2019 · 30 comments
Closed

can't compile and run my react native app #25936

icoboo opened this issue Aug 4, 2019 · 30 comments
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@icoboo
Copy link

icoboo commented Aug 4, 2019

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:

@icoboo icoboo added the Bug label Aug 4, 2019
@icoboo
Copy link
Author

icoboo commented Aug 4, 2019

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.

@bennguyen232
Copy link

thank bro!!!

@christian-hess-94
Copy link

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

@omidazm94
Copy link

omidazm94 commented Oct 19, 2019

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)

@samuelkhor97
Copy link

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\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)

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

@michivo
Copy link

michivo commented Oct 21, 2019

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.

@omidazm94
Copy link

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

@waqaramjad
Copy link

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

@waqaramjad
Copy link

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

@grayey
Copy link

grayey commented Oct 25, 2019

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 - <fullPathToYourReactNativeCli.js>)

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 <fullPathToYourReactNativeCli.js>

@ColossalisT
Copy link

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

@fxbayuanggara
Copy link

fxbayuanggara commented Nov 5, 2019

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

@hazelf42
Copy link

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

@jihadrhamza
Copy link

I tried this.
#26945 (comment).

It worked for me.

@jenygladicek
Copy link

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.

@vurso
Copy link

vurso commented Nov 20, 2019

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.

@hazelf42
Copy link

@

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.

@rvgroup
Copy link

rvgroup commented Nov 27, 2019

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

@HasanAlyazidi
Copy link

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

@ssilverr
Copy link

ssilverr commented Jan 17, 2020

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

@QuangPB
Copy link

QuangPB commented Feb 12, 2020

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

@karriz-dev
Copy link

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 😃😃😃😃

@Alexandre-Diniz
Copy link

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

@AleksandarTokarev
Copy link

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

@nexorianus
Copy link

nexorianus commented Aug 12, 2020

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

@fxbayuanggara's #25936 (comment) was the solution for me.

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

@wazimBadsha
Copy link

wazimBadsha commented Oct 12, 2020

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

@gibo77
Copy link

gibo77 commented Apr 7, 2021

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.

Works like a charm!
I did not use RN for 1 year. When I compiled I have this issue, but it was resolve because of this.

@rockingrohit9639
Copy link

Does it cause an error if there is space in the User's name?
And if so then how can I solve this problem.

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 14, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests