Hello,
i am using macos, i followed your photo-gallery tutorial to make an ionic app with capacitor and Angular. It works in the web browser, but there is a problem when trying to install the APK on the android device using the following command : “ionic cap run android -l --external” to enable live reload.
it began to build the app (by the way, is “ionic build” command included already in the first command : “ionic cap run android -l --external” ?). So the build process log gets displayed, after waiting a while the build failed because of gradle build failure. The log is below.
What i suggest is, why not make ionic standalone framework and not. depend on external applications like Android Studio for downloading gradle files and setting up the ADB cli? i suggest making a full checkup on the system for missing files before starting the project, so the developer can concentrate more on the actual coding instead of spending several hours or days fixing the dev environment.
Believe me, millions of developers struggle when it comes to setting up a working environment. I suggest making a solution like POM.XML" in maven projects, where dependencies (that are proven to work together without problems) get installed just by declaration.
Anyway, here are the logs of the building failure:
ionic cap run android -l --external
? Which device would you like to target? HUAWEI MAR-LX1M (SBXDU19426004683)
> capacitor sync android
[capacitor] ✔ Copying web assets from www to android/app/src/main/assets/public in 4.56s
[capacitor] ✔ Creating capacitor.config.json in android/app/src/main/assets in 4.66ms
[capacitor] ✔ copy android in 4.69s
[capacitor] ✔ Updating Android plugins in 29.38ms
[capacitor] [info] Found 7 Capacitor plugins for android:
[capacitor] @capacitor/app@5.0.6
[capacitor] @capacitor/camera@5.0.7
[capacitor] @capacitor/filesystem@5.1.4
[capacitor] @capacitor/haptics@5.0.6
[capacitor] @capacitor/keyboard@5.0.6
[capacitor] @capacitor/preferences@5.0.6
[capacitor] @capacitor/status-bar@5.0.6
[capacitor] ✔ update android in 658.96ms
[capacitor] [info] Sync finished in 5.363s
> ng run app:serve --host=0.0.0.0 --port=8100
[ng]
[ng] Warning: This is a simple server for use in testing or debugging Angular applications
[ng] locally. It hasn't been reviewed for security issues.
[ng]
[ng] Binding this server to an open connection can result in compromising your application or
[ng] computer. Using a different host than the one passed to the "--host" flag might result in
[ng] websocket connection issues. You might need to use "--disable-host-check" if that's the
[ng] case.
[ng]
[ng] - Generating browser application bundles (phase: setup)...
[ng] ✔ Browser application bundle generation complete.
[ng] Initial Chunk Files | Names | Raw Size
[ng] vendor.js | vendor | 3.36 MB |
[ng] polyfills.js | polyfills | 336.76 kB |
[ng] styles.css, styles.js | styles | 276.27 kB |
[ng] main.js | main | 14.61 kB |
[ng] runtime.js | runtime | 14.11 kB |
[ng]
[ng] | Initial Total | 3.99 MB
[ng]
[ng] Lazy Chunk Files | Names | Raw Size
[ng] polyfills-core-js.js | polyfills-core-js | 304.25 kB |
[ng] node_modules_ionic_core_dist_esm_ion-datetime_3_entry_js.js | - | 150.15 kB |
[ng] node_modules_ionic_core_dist_esm_ion-item_8_entry_js.js | - | 91.81 kB |
[ng] node_modules_ionic_core_dist_esm_ion-modal_entry_js.js | - | 86.12 kB |
[ng] node_modules_ionic_core_dist_esm_ion-select_3_entry_js.js | - | 76.68 kB |
[ng] node_modules_ionic_core_dist_esm_ion-app_8_entry_js.js | - | 76.38 kB |
[ng] node_modules_ionic_core_dist_esm_ion-textarea_entry_js.js | - | 63.97 kB |
[ng] node_modules_ionic_core_dist_esm_ion-popover_entry_js.js | - | 63.15 kB |
[ng] node_modules_ionic_core_dist_esm_ion-input_entry_js.js | - | 61.43 kB |
[ng] node_modules_ionic_core_dist_esm_ion-refresher_2_entry_js.js | - | 60.38 kB |
[ng] default-node_modules_ionic_core_dist_esm_data-009dbf15_js-node_modules_ionic_core_dist_esm_th-b84f04.js | - | 56.37 kB |
[ng] polyfills-dom.js | polyfills-dom | 53.11 kB |
[ng] node_modules_ionic_core_dist_esm_ion-range_entry_js.js | - | 52.82 kB |
[ng] node_modules_ionic_core_dist_esm_ion-alert_entry_js.js | - | 52.08 kB |
[ng] node_modules_ionic_core_dist_esm_ion-menu_3_entry_js.js | - | 45.85 kB |
[ng] node_modules_ionic_core_dist_esm_ion-toggle_entry_js.js | - | 45.16 kB |
[ng] node_modules_ionic_core_dist_esm_ion-segment_2_entry_js.js | - | 41.13 kB |
[ng] node_modules_ionic_core_dist_esm_ion-button_2_entry_js.js | - | 40.00 kB |
[ng] src_app_tab2_tab2_page_ts.js | tab2-tab2-page | 39.00 kB |
[ng] node_modules_ionic_core_dist_esm_ion-searchbar_entry_js.js | - | 38.29 kB |
[ng] node_modules_ionic_core_dist_esm_ion-nav_2_entry_js.js | - | 37.75 kB |
[ng] node_modules_ionic_core_dist_esm_ion-item-option_3_entry_js.js | - | 37.39 kB |
[ng] node_modules_ionic_core_dist_esm_ion-radio_2_entry_js.js | - | 36.94 kB |
[ng] common.js | common | 36.16 kB |
[ng] node_modules_ionic_core_dist_esm_ion-route_4_entry_js.js | - | 34.93 kB |
[ng] node_modules_ionic_core_dist_esm_ion-toast_entry_js.js | - | 33.38 kB |
[ng] node_modules_ionic_pwa-elements_dist_esm_pwa-camera_entry_js.js | pwa-camera-entry-js | 32.76 kB |
[ng] node_modules_ionic_core_dist_esm_ion-action-sheet_entry_js.js | - | 31.81 kB |
[ng] node_modules_ionic_core_dist_esm_ion-checkbox_entry_js.js | - | 29.60 kB |
[ng] node_modules_ionic_core_dist_esm_ion-fab_3_entry_js.js | - | 29.57 kB |
[ng] node_modules_ionic_core_dist_esm_ion-picker-column-internal_entry_js.js | - | 28.30 kB |
[ng] node_modules_ionic_core_dist_esm_ion-accordion_2_entry_js.js | - | 28.13 kB |
[ng] node_modules_ionic_core_dist_esm_ion-tab-bar_2_entry_js.js | - | 27.34 kB |
[ng] node_modules_ionic_core_dist_esm_input-shims-d78a3c77_js.js | input-shims-d78a3c77-js | 26.62 kB |
[ng] node_modules_ionic_core_dist_esm_ion-picker-internal_entry_js.js | - | 24.72 kB |
[ng] node_modules_ionic_core_dist_esm_ion-progress-bar_entry_js.js | - | 24.05 kB |
[ng] node_modules_ionic_core_dist_esm_ion-breadcrumb_2_entry_js.js | - | 23.06 kB |
[ng] node_modules_ionic_core_dist_esm_ion-loading_entry_js.js | - | 22.30 kB |
[ng] node_modules_ionic_core_dist_esm_ion-reorder_2_entry_js.js | - | 21.00 kB |
[ng] node_modules_ionic_core_dist_esm_ion-datetime-button_entry_js.js | - | 18.68 kB |
[ng] node_modules_ionic_core_dist_esm_ion-back-button_entry_js.js | - | 17.86 kB |
[ng] node_modules_ionic_core_dist_esm_ion-card_5_entry_js.js | - | 17.32 kB |
[ng] default-node_modules_ionic_core_dist_esm_form-controller-ed77647a_js-node_modules_ionic_core_-6a9da8.js | - | 17.08 kB |
[ng] default-node_modules_ionic_core_dist_esm_button-active-7180a130_js-node_modules_ionic_core_di-aac251.js | - | 15.27 kB |
[ng] default-node_modules_ionic_core_dist_esm_keyboard-controller-0c2dce71_js-node_modules_ionic_c-b0fbc0.js | - | 15.08 kB |
[ng] node_modules_ionic_core_dist_esm_ion-infinite-scroll_2_entry_js.js | - | 13.50 kB |
[ng] node_modules_ionic_core_dist_esm_ion-col_3_entry_js.js | - | 13.25 kB |
[ng] node_modules_capacitor_camera_dist_esm_web_js.js | web | 12.34 kB |
[ng] node_modules_ionic_core_dist_esm_ion-spinner_entry_js.js | - | 10.97 kB |
[ng] node_modules_ionic_core_dist_esm_ion-tab_2_entry_js.js | - | 10.53 kB |
[ng] node_modules_ionic_core_dist_esm_ion-split-pane_entry_js.js | - | 9.11 kB |
[ng] node_modules_ionic_core_dist_esm_ion-avatar_3_entry_js.js | - | 7.91 kB |
[ng] node_modules_ionic_core_dist_esm_ion-chip_entry_js.js | - | 7.30 kB |
[ng] node_modules_ionic_core_dist_esm_index-f0cc4e14_js.js | index-f0cc4e14-js | 6.84 kB |
[ng] node_modules_ionic_core_dist_esm_ion-ripple-effect_entry_js.js | - | 6.30 kB |
[ng] src_app_tabs_tabs_routes_ts.js | tabs-tabs-routes | 5.00 kB |
[ng] node_modules_ionic_core_dist_esm_ion-img_entry_js.js | - | 4.63 kB |
[ng] node_modules_ionic_core_dist_esm_ion-text_entry_js.js | - | 4.24 kB |
[ng] node_modules_ionic_pwa-elements_dist_esm_pwa-action-sheet_entry_js.js | pwa-action-sheet-entry-js | 4.23 kB |
[ng] node_modules_ionic_pwa-elements_dist_esm_pwa-camera-modal-instance_entry_js.js | pwa-camera-modal-instance-entry-js | 4.12 kB |
[ng] node_modules_ionic_pwa-elements_dist_esm_pwa-camera-modal_entry_js.js | pwa-camera-modal-entry-js | 3.92 kB |
[ng] node_modules_ionic_core_dist_esm_ion-backdrop_entry_js.js | - | 3.24 kB |
[ng] src_app_tab1_tab1_page_ts.js | tab1-tab1-page | 3.14 kB |
[ng] src_app_tab3_tab3_page_ts.js | tab3-tab3-page | 3.14 kB |
[ng] node_modules_ionic_core_dist_esm_status-tap-73e982b6_js.js | status-tap-73e982b6-js | 2.97 kB |
[ng] node_modules_ionic_pwa-elements_dist_esm_pwa-toast_entry_js.js | pwa-toast-entry-js | 2.73 kB |
[ng]
[ng] Build at: 2023-10-09T18:59:37.214Z - Hash: 0ec537a3c0de6141 - Time: 23651ms
[ng] ✔ Compiled successfully.
[INFO] Development server running!
Local: http://localhost:8100
External: http://192.168.1.17:8100
Use Ctrl+C to quit this process
> capacitor run android --no-sync --target SBXDU19426004683
[capacitor] ✖ Running Gradle build - failed!
[capacitor] [error] Starting a Gradle Daemon (subsequent builds will be faster)
[capacitor]
[capacitor] FAILURE: Build failed with an exception.
[capacitor]
[capacitor] * What went wrong:
[capacitor] Could not open settings generic class cache for settings file '/Users/"MYCOMPUTERNAME"/Desktop/Files/Sandbox/React projects/ionic/photo-gallery/android/settings.gradle' (/Users/"MYCOMPUTERNAME"/.gradle/caches/8.0.2/scripts/41bleq3pqmzd04rqmo279sxv9).
[capacitor] > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 64
[capacitor]
[capacitor] * Try:
[capacitor] > Run with --stacktrace option to get the stack trace.
[capacitor] > Run with --info or --debug option to get more log output.
[capacitor] > Run with --scan to get full insights.
[capacitor]
[capacitor] * Get more help at https://help.gradle.org
[capacitor]
[capacitor] BUILD FAILED in 11s
[capacitor]
[ERROR] An error occurred while running subprocess capacitor.
capacitor run android --no-sync --target SBXDU19426004683 exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.