These are my notes on generating an APK file using Android Studio, for a Gatsby project using Capacitor.
This is the flow I follow to create the APK:
- Update the capacitor.config file with the route where is installed the Android studio
npm run build
(generates the public folder)npm run android:setup
(generates the android folder)npm run android:open
(opens the android studio with the project)- Once in Android studio I compile and export the APK: Build --> Make Project
- The generated APK file is in
android/app/build/outputs/apk/debug/app-debug.apk
The problems I have found with this, are related with the versions, the 'gacdle' and 'sdk' versions need to be compatible