Android Mobile App Simulator Set Up - McGill-ECSE321-Winter2022/project-group-group-08 GitHub Wiki
If any issue arises, please contact (873) 354-3761
Windows Setup
- cd into the IonicFrontend Folder in terminal
- run
npm install
in terminal - run
npm run build
- Setting up Capacitor
- (If you don't have @capacitor installed) run
npm install @capacitor/android
- (If you have @capacitor installed) Replace the sdk directory path by modifying the line with
sdk.dir
inGroceryStore-IonicFrontend > android > local properties
- run
npx cap run
(you may expect an error, but this initializes the process) - select
android
- run
npx cap open
- select
android
(Refer to figure 1) if it does not run, check your Gradle JDK version in Android Studio. Ensure that it is version 11. Downgrade it by going to
File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK
Wait until Gradle finish compiling
- Run the app on the simulator by clicking "Start" (green triangle)
Potential Problems (go back to step 5 when fixed)
-
incompatible JDK version (Gradle JDK version 11 will for sure work)
-
Android Studio current API level is not 31 (the API level 31 will for sure work)
Mac Setup
- cd into the IonicFrontend Folder in terminal
- run
npm install
in terminal - run
npm run build
- Setting up Capacitor
- (If you don't have @capacitor installed) run
npm install @capacitor/android
- (If you have @capacitor installed) Replace the sdk directory path by modifying the line with
sdk.dir
inGroceryStore-IonicFrontend > android > local properties
- run
npx cap run
(you may expect an error, but this initializes the process) - select
android
- run
npx cap open
- select
android
(Refer to figure 1) if it does not run, check your Gradle JDK version in Android Studio. Ensure that it is version 11. Downgrade it by going to
Android Studio > Preferences > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK
Wait until Gradle finish compiling
- Run the app on the simulator by clicking "Start" (green triangle)
Potential Problems (go back to step 5 when fixed)
-
incompatible JDK version (Gradle JDK version 11 will for sure work)
-
Android Studio current API level is not 31 (the API level 31 will for sure work)