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

The current character read is 'i' with an int value of 105 #1984

Closed
feralxan opened this issue Jun 23, 2023 · 17 comments
Closed

The current character read is 'i' with an int value of 105 #1984

feralxan opened this issue Jun 23, 2023 · 17 comments

Comments

@feralxan
Copy link

Environment

rakhmanuye@rakhmans-MacBook-Pro thg-mobile % react-native info
info Fetching system and libraries information...
(node:59812) 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: macOS 13.4
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Memory: 119.59 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.3.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.6.7 - /usr/local/bin/npm
Watchman: 2023.06.12.00 - /usr/local/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 17.0.7 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.10 => 0.69.10
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Description

rakhmanuye@rakhmans-MacBook-Pro thg-mobile % yarn run android --verbose
yarn run v1.22.19
$ react-native run-android --verbose
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1639 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...
debug Running command "cd android && ./gradlew app:installDebug -PreactNativeDevServerPort=8081"

FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/rakhmanuye/projects/thg-mobile/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 250

  • What went wrong:
    A problem occurred evaluating script.

Calling [node, /Users/rakhmanuye/projects/thg-mobile/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 2s

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 app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/rakhmanuye/projects/thg-mobile/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 250

  • What went wrong:
    A problem occurred evaluating script.

Calling [node, /Users/rakhmanuye/projects/thg-mobile/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 2s

at makeError (/Users/rakhmanuye/projects/thg-mobile/node_modules/execa/index.js:174:9)
at /Users/rakhmanuye/projects/thg-mobile/node_modules/execa/index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (/Users/rakhmanuye/projects/thg-mobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/rakhmanuye/projects/thg-mobile/node_modules/@react-native-community/cli/build/index.js:192:9)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

this error come because i add react-native-image-picker ^5.6.0

@OFD16
Copy link

OFD16 commented Jun 27, 2023

i have same issue same error also i didnt add new package. I just deleted my repo on local and downloaded again on github with github desktop.

`BU�LD FAILED in 7s

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:installDevDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\Users\CABBAR\Documents\githubrepo\TarifistClient\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 450

  • What went wrong:
    A problem occurred evaluating script.

Calling [node, C:\Users\CABBAR\Documents\githubrepo\TarifistClient\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.

BU�LD FAILED in 7s

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

@VEmpink
Copy link

VEmpink commented Jun 28, 2023

same issue here, it only works when I do deletenode_modules and yarn install again but the error will appear again if I run the second build (yarn react-native run-android), which means I must delete node_modules and yarn install again every single time I want to develop/build the app, but I found an issue when i add react-native-cameraroll

I've already tried it on my both device which is Windows 11 and MacOS Ventura 13.3.1 and the issue is still the same

@pasaninsharp
Copy link

having this after adding react-native-image-picker

@VEmpink
Copy link

VEmpink commented Jun 28, 2023

same issue here, it only works when I do deletenode_modules and yarn install again but the error will appear again if I run the second build (yarn react-native run-android), which means I must delete node_modules and yarn install again every single time I want to develop/build the app, but I found an issue when i add react-native-cameraroll

I've already tried it on my both device which is Windows 11 and MacOS Ventura 13.3.1 and the issue is still the same

I finally fixed it for my both device Windows 11 and MacOS Ventura

in my case i just downgrade from "@react-native-camera-roll/camera-roll": "^5.7.1" to "@react-native-camera-roll/camera-roll": "5.3.0"

nodejs: v18.16.1
yarn: v1.22.19

@VEmpink
Copy link

VEmpink commented Jun 28, 2023

having this after adding react-native-image-picker

try downgrading the version maybe?

@dr1verrr
Copy link

dr1verrr commented Jun 30, 2023

Please check an output from this command: npx --quiet react-native config
Then you may have to modify AndroidManifest.xml in some package(add package attribute with its package name)

@szymonrybczak
Copy link
Collaborator

szymonrybczak commented Jul 7, 2023

Hello 👋 This is probably not issue related to React Native CLI - but related to libraries, please try upgrading them (libraries such as react-native-image-picker or react-native-cameraroll or any other) - probably in these libraries were introduced breaking change that breaks your app. Please also try creating fresh React Native app with npx react-native@latest init command and say is it working for you correctly.

@feralxan
Copy link
Author

problem solved after i trying downgrade react-native-image-picker to ^4.0.3

@dr1verrr
Copy link

For me problem solved after I did check my logs, and realized that problem was in react-native-camera-roll/camera-roll.
Then I updated its package and finally it solved.

@abdulmomin703
Copy link

@dr1verrr I am also facing the issue when using react-native-camera-roll/camera-roll. How did you manage to solve the issue?

@szymonrybczak
Copy link
Collaborator

Hey @abdulmomin703, please see #1981 (comment)

@djguruwap
Copy link

djguruwap commented Aug 3, 2023

I have spent 1 day with these issue. And finally able to resolved with increasing the react-native version.
Test which version is working for you.

I have 0.69.5 and i have upgraded to 0.70.0.

it works !

@raulglezrdguez
Copy link

it works with: "react-native-image-picker": "^4.10.3"

@guruatdigni
Copy link

Try with yarn once instead of npm.

@ahmadAlMezaal
Copy link

ahmadAlMezaal commented Sep 26, 2023

same issue here, it only works when I do deletenode_modules and yarn install again but the error will appear again if I run the second build (yarn react-native run-android), which means I must delete node_modules and yarn install again every single time I want to develop/build the app, but I found an issue when i add react-native-cameraroll
I've already tried it on my both device which is Windows 11 and MacOS Ventura 13.3.1 and the issue is still the same

I finally fixed it for my both device Windows 11 and MacOS Ventura

in my case i just downgrade from "@react-native-camera-roll/camera-roll": "^5.7.1" to "@react-native-camera-roll/camera-roll": "5.3.0"

nodejs: v18.16.1 yarn: v1.22.19

I've tried this solution, but it didn't work. However, downgrading @react-native-camera-roll/camera-roll to 5.6.0 worked like a charm on both Android & iOS

@arthedza
Copy link

arthedza commented Jun 20, 2024

The problem is that the package attribute is initially present in the camera-roll manifest file, but for some reason it is removed from it after running Gradle. That's why this error disappears after removing node_modules but occurs again after running a build once again. Perhaps Gradle merges manifest files somehow incorrectly. If you remove the package attribute from the manifest file of your application (android/app/src/main/AndroidManifest.xml), you will not get this error (although then you will get another error saying that the package attribute must be present in the manifest file of your application). In the node_modules/@react-native-camera-roll/camera-roll/android/build.gradle file there's a property of namespace however, it is used conditionally. Maybe it should always be included?
image

UPD. I just changed the line def shouldUseNameSpace = agpVersion >= 7 to def shouldUseNameSpace = false and created a patch using patch-package and the issue was resolved for me.

@anazcodesap
Copy link

That worked for me: Inside packagename/AndroidManifest.xml, inside manifest tag just add package="com.package_name"

npx --quiet react-native config - through this command i have found the package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests