4

Description Previously I wanted to continue to finish my React Native Android application, but after running it, an error like this has never happened before:

Error Details FAILURE: Build failed with an exception.

  • Where: Script 'D:\KonselingTelyu\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 450

  • What went wrong: A problem occurred evaluating script.

Calling [node, D:\KonselingTelyu\node_modules\@react-native-community\cli\build\bin.js, config] finished with an exception. Error message: groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

The current character read is 'i' with an int value of 105 Unable to determine the current character, it is not a string, number, array, or object line number 1 index number 0 info Run CLI with --verbose flag for more details. ^. Output: info Run CLI with --verbose flag for more details.

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

BUILD FAILED in 3m 24s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • Where: Script 'D:\KonselingTelyu\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 450

  • What went wrong: A problem occurred evaluating script.

Calling [node, D:\KonselingTelyu\node_modules\@react-native-community\cli\build\bin.js, config] finished with an exception. Error message: groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

The current character read is 'i' with an int value of 105 Unable to determine the current character, it is not a string, number, array, or object line number 1 index number 0 info Run CLI with --verbose flag for more details. ^. Output: info Run CLI with --verbose flag for more details.

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

BUILD FAILED in 3m 24s

at makeError (D:\KonselingTelyu\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at D:\KonselingTelyu\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (D:\KonselingTelyu\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\KonselingTelyu\node_modules\@react-native-community\cli\build\index.js:142:9)

info Run CLI with --verbose flag for more details.

  • react-native info

D:\KonselingTelyu>react-native info info Fetching system and libraries information... (node:4328) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created) System: OS: Windows 10 10.0.19045 CPU: (4) x64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz Memory: 6.69 GB / 11.90 GB Binaries: Node: 18.12.1 - C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: 9.7.2 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 28, 30, 31, 33 Build Tools: 28.0.3, 30.0.2, 30.0.3, 31.0.0 System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom Android NDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Version 2020.3.0.0 AI-203.7717.56.2031.7678000 Visual Studio: Not Found Languages: Java: 11.0.17 npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.6 => 0.70.6 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

  • npm list @react-native-community/cli

[email protected] D:\KonselingTelyu -- [email protected] -- @react-native-community/[email protected]

  • package.json

{ "name": "KonselingTelyu", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@firebase/firestore": "^3.12.0", "@react-native-async-storage/async-storage": "^1.17.11", "@react-native-firebase/app": "^17.5.0", "@react-native-firebase/firestore": "^17.5.0", "@react-navigation/bottom-tabs": "^6.5.2", "@react-navigation/native": "^6.1.1", "@react-navigation/stack": "^6.3.10", "@reduxjs/toolkit": "^1.9.5", "firebase": "^9.16.0", "react": "18.1.0", "react-native": "0.70.6", "react-native-flash-message": "^0.4.0", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.8.0", "react-native-image-picker": "^5.0.1", "react-native-restart": "^0.0.24", "react-native-safe-area-context": "^4.4.1", "react-native-screens": "^3.18.2", "react-native-svg": "^13.6.0", "react-native-svg-transformer": "^1.0.0", "react-native-update-cli": "^1.11.0", "react-native-version-check": "^3.4.7", "react-redux": "^8.1.1", "xlsx": "^0.18.5" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "^7.32.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "0.72.3", "react-test-renderer": "18.1.0" }, "jest": { "preset": "react-native" } }

2
  • the same issue, I face this issue when build turns 2, I must clean the project to rebuild to fix this. But this way lost many time Commented Jul 4, 2023 at 10:31
  • I face this issue when add lib: @react-native-camera-roll/camera-roll Commented Jul 4, 2023 at 10:32

4 Answers 4

1

Reinstalling node_modules helped me:

rm -rf node_modules
yarn install
Sign up to request clarification or add additional context in comments.

1 Comment

this approach helped me, thanks
1

In case you are still facing similar issue, and the above solutions did not work, here is a solution that worked for me:

First,I ran the following command to identify which file was the root cause:

node ./node_modules/@react-native-community/cli/build/bin.js config

This returned the following, indicating an issue with the AndroidManifest.xml of my react-native-screens dependency. Specifically, the package declaration was missing:

error Failed to build the app: No package name found. Found errors in <root-path>\node_modules\react-native-screens\android\src\main\AndroidManifest.xml.

Please not that the issue might be on another dependency.

Once you've identified the issue, just add the necessary package i.e

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.swmansion.rnscreens"> </manifest>

Note that I also downgraded my node version to 18,although it is not a mandatory action.

1 Comment

it worked for me
0

I also encountered this situation, and in order to save time, I executed the following command:

rm -rf ./android/app/release

I am using Android Studio to generate an APK, so the directory mentioned is /android/app/release.

1 Comment

Doesn't work for me.
0

I had the same issue for days but i was able to resolve it by using yarn install expo@^48.0.0 to upgrade my expo project and npx expo install --fix to fix all dependencies to match the SDK 48.

I hope this helps someone.

1 Comment

you need to know that we use yarn add for installing dependencies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.