question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:

See original GitHub issue

Ask your Question

Just created a new react-native project using npx react-native init, but after initializing the project running npx react-native run-android throws the error =>

Android project not found. Are you sure this is a React Native project? If your Android files are located in a non-standard location (e.g. not inside ‘android’ folder), consider setting project.android.sourceDir option to point to a new location.

while android folder is in the root dir.

I also Tried to sync the gradle files and it throws the following error =>

java.lang.Exception: React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:

i’ve followed various approaches from setting up a react-native react-native.config file to deleting and reinstalling node modules nothing seems to work while i’m still able to run my old react-native project.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:14

github_iconTop GitHub Comments

6reactions
marqroldancommented, May 14, 2022

Edit: I hid the comment above, but this issue only happens on Windows

This might be an issue with the glob package; I tried this sample code that looks for the AndroidManifest.xml

const glob = require('glob');
const path = require('path');
const fs = require('fs');

console.log(glob.sync(path.join('**', 'AndroidManifest.xml'), {
    cwd: 'android'
}))

With glob@7.2.0, it works, but with glob@7.2.2 it fails to return anything

image

7.2.2 was released 6 hours ago


Update:

Manually setting options.allowWindowsEscape to false seems to fix everything

I think it’s not meant to be released in 7.2.2


Edit 3:

You can add another entry in the resolutions part of your package.json, so that it installs 7.2.0 instead of 7.2.2

  "resolutions": {
    "glob": "7.2.0"
  },
4reactions
MarcosGoncalvesPirescommented, May 15, 2022

There is a solution on this video… https://www.youtube.com/watch?v=AQqYPRHTTYI after some days lookink for I found it and it solved the issue.

SOLUTION - nodeModules – Glob – common.js – options.allowWindowsScape = true…. change to “false”….

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native CLI failed to determine Android project ...
After changing the main app/module name to app and moving the entire Android application into a android sub directory, things started to work ......
Read more >
Cli-platform-android and react-native failed due to Gradle ...
Run with --scan to get full insights. I clicked the blue bar message "Gradle project sync failed (…) Try again Open 'Build' View...
Read more >
npx react-native run-android build failed - You.com
I get this error when i run npx react-native run-android in folder. ... gradlew.bat installDebug --stacktrace > Configure project :app The ...
Read more >
Addressing common errors in React Native - LogRocket Blog
Explore common React Native errors such as "command not found" and learn about their causes and potential solutions.
Read more >
Fixed: React Native new Android project Build Issue - YouTube
Fixed: React Native new Android project Build IssueIn this video, I will take you through a Step by step guide to fix Android...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found