Skip to content
Advertisement

Error: Unable to determine the current character, it is not a string, number, array, or object in react-native for android

Whenever I run react-native run-android while keeping the emulator running, I get this error. react-native run-ios wroks completely fine.

JavaScript

As indicated in the error message, I tried running npm uninstall -g react-native react-native-cli but it didn’t work.

Info about my environment:

JavaScript

android/app/build.gradle below:

JavaScript

android/build.gradle below :

JavaScript

Initially I was getting this error: react-native build error: Could not find method implementation() for arguments [jscFlavor] on project ‘:app’ of type org.gradle.api.Project but now I am getting the above.

Advertisement

Answer

SOLUTION 1 (worked for me)

The solution for me was removing the following line

JavaScript

Be sure to remove it everywhere. I had this line in build.gradle (app) and also in settings.gradle.

After that, run again npx react-native run-android the console will display the real error, fix the error and put back the lines you had removed.

In my case the error happened because I have been using an older Node version and the second time It happened I needed to sync my project again


SOLUTION 2

Delete the files it was finding error as “The current character read is ‘E’ with an int value of 69”

Deleting

JavaScript

worked for others too.


SOLUTION 3

Update the @react-native-community/cli to the latest version.

Good coding!

Advertisement