When I try to run a react native project with the command react-native run-android a 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." Is displayed.The first two projects I created ran correctly, but them every new project I create displays the same error when I try to run then in the emulator. Someone knows why is this error due to?
CodePudding user response:
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]"