NOTES: Im new in react native and i see there are so many approaches and with this error i thought the developer who built this app build it differently from what i learn so i don't understand why he didn't put the android folder
so i just joined a project and im going to run the apps in my pc by cloning it from github but when i try to npx react-native run-android
it failed to run and the log is like this
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.
info Run CLI with --verbose flag for more details.
the folder structure is like this
CodePudding user response:
The files show that the project is created with Expo. Specifically, you have a managed expo project.
npx react-native run-android
would compile an android app from source, with Expo's managed workflow that's not needed. You will need the Expo Go App.
Expo also comes with its own commands to start the bundler. Instead of running npx react-native ...
make use of the expo-cli running: npx expo start
However, in the package.json
there is very likely a script
called start
. In that case, it's easier for you to run npm start
.
After running this command the expo console opens. Here you can press a
to open the app using expo go (or instructions on how to do so).
Alternatively, you can run npx expo run:android
to start the expo go app on android yourself.
CodePudding user response:
you are using an expo, there is a folder named .expo-shared, after
npm install
Try to run
npm start
or
expo start
or
npx expo start
something like this will appear: https://imgur.com/U9I7Gf4 after that go to the terminal, open the emulator in you computer and click on the terminal and press 'a',