1
votes

ReactNative:Failed to parse React Native CLI configuration: groovy.json.JsonException: 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 Error: EACCES: permission denied, scandir '/home/sanju/AwesomeProject/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com' at Object.fs.readdirSync (fs.js:904:18) at GlobSync._readdir (/home/sanju/AwesomeProject/node_modules/glob/sync.js:288:41) at GlobSync._readdirInGlobStar (/home/sanju/AwesomeProject/node_modules/glob/sync.js:267:20) at GlobSync._readdir (/home/sanju/AwesomeProject/node_modules/glob/sync.js:276:17) at GlobSync._processReaddir (/home/sanju/AwesomeProject/node_modules/glob/sync.js:137:22) at GlobSync._process (/home/sanju/AwesomeProject/node_modules/glob/sync.js:132:10) at GlobSync._processGlobStar (/home/sanju/AwesomeProject/node_modules/glob/sync.js:380:10) at GlobSync._process (/home/sanju/AwesomeProject/node_modules/glob/sync.js:130:10) at GlobSync._processGlobStar (/home/sanju/AwesomeProject/node_modules/glob/sync.js:383:10) at GlobSync._process (/home/sanju/AwesomeProject/node_modules/glob/sync.js:130:10) ^

FAILURE: Build failed with an exception.

  • Where: Script '/home/sanju/AwesomeProject/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 200

  • What went wrong: A problem occurred evaluating script.

    Failed to parse React Native CLI configuration. Expected running 'npx --quiet --no-install react-native config' command from '/home/sanju/AwesomeProject' directory to output valid JSON, but it didn't. This may be caused by npx resolving to a legacy global react-native binary. Please make sure to uninstall any global 'react-native' binaries: 'npm uninstall -g react-native react-native-cli' and try again

  • 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 1s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 :ReactNative:Failed to parse React Native CLI configuration: groovy.json.JsonException: 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 Error: EACCES: permission denied, scandir '/home/sanju/AwesomeProject/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com' at Object.fs.readdirSync (fs.js:904:18) at GlobSync._readdir (/home/sanju/AwesomeProject/node_modules/glob/sync.js:288:41) at GlobSync._readdirInGlobStar (/home/sanju/AwesomeProject/node_modules/glob/sync.js:267:20) at GlobSync._readdir (/home/sanju/AwesomeProject/node_modules/glob/sync.js:276:17) at GlobSync._processReaddir (/home/sanju/AwesomeProject/node_modules/glob/sync.js:137:22) at GlobSync._process (/home/sanju/AwesomeProject/node_modules/glob/sync.js:132:10) at GlobSync._processGlobStar (/home/sanju/AwesomeProject/node_modules/glob/sync.js:380:10) at GlobSync._process (/home/sanju/AwesomeProject/node_modules/glob/sync.js:130:10) at GlobSync._processGlobStar (/home/sanju/AwesomeProject/node_modules/glob/sync.js:383:10) at GlobSync._process (/home/sanju/AwesomeProject/node_modules/glob/sync.js:130:10) ^

FAILURE: Build failed with an exception.

  • Where: Script '/home/sanju/AwesomeProject/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 200

  • What went wrong: A problem occurred evaluating script.

    Failed to parse React Native CLI configuration. Expected running 'npx --quiet --no-install react-native config' command from '/home/sanju/AwesomeProject' directory to output valid JSON, but it didn't. This may be caused by npx resolving to a legacy global react-native binary. Please make sure to uninstall any global 'react-native' binaries: 'npm uninstall -g react-native react-native-cli' and try again

  • 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 1s

at checkExecSyncError (child_process.js:601:13)
at execFileSync (child_process.js:621:13)
at runOnAllDevices (/home/sanju/AwesomeProject/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)
1
Did you try remove node_modules and re-installing it ?Akila Devinda
yes it did not helpSanju Pipal
try "cd android" in your project directory and then "./gradlew clean" and then try againMoHammaD ReZa DehGhani
~/Android$ ./gradlew clean bash: ./gradlew: No such file or directorySanju Pipal
sure you are in your android folder and run './gradlew clean' ?MoHammaD ReZa DehGhani

1 Answers

0
votes

This is a temporary issue with the CLI. We're tackling it already react-native-community/cli#863