'React native CLI : Android project not found. Are you sure this is a React Native project?

when I tried to run the react native project on android by command npm run android I got this error:

The 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 the 'android' folder), consider setting project.android.sourceDir option to point to a new location.info Run CLI with --verbose flag for more details.



Solution 1:[1]

  1. To resolve the issue please upgrade the react-native package.

  2. Go to the Project root.

  3. Upgrade the React native package in the Command Prompt by typing react-native upgrade

  4. Then Accept to update all the Files by typing y (Yes) in the Command Prompt.

Reference: https://github.com/facebook/react-native/issues/9312 and also use the command : npx react-native run-android

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 noob