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

  1. cd into the IonicFrontend Folder in terminal
  2. run npm install in terminal
  3. run npm run build
  4. 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 in GroceryStore-IonicFrontend > android > local properties
  1. run npx cap run (you may expect an error, but this initializes the process)
  2. select android
  3. run npx cap open
  4. 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

  1. 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

  1. cd into the IonicFrontend Folder in terminal
  2. run npm install in terminal
  3. run npm run build
  4. 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 in GroceryStore-IonicFrontend > android > local properties
  1. run npx cap run (you may expect an error, but this initializes the process)
  2. select android
  3. run npx cap open
  4. 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

  1. 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)

Figure 1