0

When I try to run a react native project with the command react-native run-android the following exception is a displayed:

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

The first two projects I created ran correctly, but since then every new project created displays the above exception when I try to run them in the emulator. Can someone help clarify why I am encountering this exception?

2
  • Refer to the answers in this question to see if it can help with the above: stackoverflow.com/q/43723958/11543023 Commented May 15, 2022 at 6:18
  • I think this is because of the new version glob package in the current react-native dependency. Commented May 15, 2022 at 15:43

1 Answer 1

1

The issue comes after the glob package version 7.2.2 was released. Version 7.2.2 has allowWindowsEscape = true

options.allowWindowsEscape = false // This should be false

However, you can add the 7.2.0 version in package.json.

Follow the below steps to fix this:

  • Delete node_modules
  • add this to package.json "resolutions": { "glob": "7.2.0" }
  • Reinstall node_modules with npm install

If this does not work try the below command

"npm i [email protected]"

Sign up to request clarification or add additional context in comments.

2 Comments

Yes that was the problem, thanks!!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.