System:
OS: Linux 5.0 Ubuntu 18.04.2 LTS (Bionic Beaver)
CPU: (4) x64 Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz
Memory: 2.97 GB / 11.64 GB
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 8.10.0 - /usr/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.1 => 0.61.1
npmGlobalPackages:
react-native-cli: 2.0.1
FAILURE: Build failed with an exception.
Where:
Script '/home/nahid/code/finder-driver-fe-app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 206
What went wrong:
A problem occurred evaluating script.
React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:
[root:/home/nahid/code/finder-driver-fe-app/android, reactNativePath:/home/nahid/code/finder-driver-fe-app/node_modules/react-native, dependencies:[:], commands:[], assets:[], platforms:[:], haste:[providesModuleNodeModules:[], platforms:[]], project:[:]]
create two project with cli different react native version like 60.5 and 61.1 . set port of one app to 9988 .
react-native run-android
am facing the exact same issue right now after running "gradlew clean"
same issue with me
What helped me is run yarn install. This way I saw that package.json had invalid format. Fixed it and then everything worked fine. Maybe this is your problem, too?
Is there a solution?
also experiencing this
I was hitting this issue and blocked by it. For my case, was attempting to use the cli to add fonts to the project and I had changed the module.
So for me, this was caused by an android/app/src/main/assets/fonts folder with fonts when my fonts should instead be located in android/<new_module_name>/src/main/assets/fonts.
Removing the app directory and all of its contents (just the font files) fixed it for me. DON'T do this if the module you're trying to build is still named app.
What helped me is run
yarn install. This way I saw thatpackage.jsonhad invalid format. Fixed it and then everything worked fine. Maybe this is your problem, too?
Could you specify what you fixed?
Please point a valid reproduction - ideally a repository with the files I can try, or output of running react-native config from the root of your project.
Also, make sure you're latest. I am going. to close this in the meantime.
In our case, we have an atypical structure since we added React Native to an existing Android application years ago. After changing the main app/module name to app and moving the entire Android application into a android sub directory, things started to work without an issue.
I'm sure you could configure things to make the non-standard structure work, which we were doing previously, but with the advent of autolinking, the extra hoop jumping didn't feel warranted. So we caved to the defaults and are moving forward now.
Most helpful comment
What helped me is run
yarn install. This way I saw thatpackage.jsonhad invalid format. Fixed it and then everything worked fine. Maybe this is your problem, too?