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?

djmonki
  • 3,020
  • 7
  • 18

1 Answers1

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 glob@7.2.0"

Kapil Lohakare
  • 320
  • 2
  • 7