I've tried setting up the below react apps locally and this is working as expected, however, when I try to install capacitor to these react apps and execute it from android studio. The app is opening up with a blank screen.
https://github.com/aditya-sridhar/simple-reactjs-app
https://github.com/arnab-datta/counter-app
Steps followed for adding a capacitor to react app and running it on android studio are as follows
- Clone/Download the app from github
- Do an npm install
- Bring up the app locally to check if the app works from the browser
- Bring down the app
- Install npm install @capacitor/core
- Install npm install @capacitor/cli --save-dev
- Initialize Capacitor using npx cap init and proceed with default values
- Install npm install @capacitor/android
- Do npm run build
- Add android platform using npx cap add android
- Run android platform using npx cap run android
Note: While doing, npx cap run android I got an error and added local.properties in the generated Android folder.
Screen Image as follows
