Android icon not changing
If the Android app icon is not changing from the default icon (in my situation this was the Capacitor icon), here are some steps to troubleshoot and resolve the issue:
Check the Icon Files
Ensure that you have provided the correct icon files in the appropriate directory. In a Capacitor project, the Android app icon should be placed in the res directory under various density-specific folders (e.g., mipmap-hdpi, mipmap-mdpi, mipmap-xhdpi, etc.).
The application could not be installed: INSTALL_FAILED_INSUFFICIENT_STORAGE
error: package android.support.v4.content does not exist
Android Studio error
error: package android.support.v4.content does not exist
This is a problem with plugins using old Android support dependencies instead of the AndroidX equivalent. As it's a dependency issue, to resolve add jetifier. I know yet another package...
npm install jetifier
npx jetify
npx cap sync
Build failed error: cannot find symbol Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
Android Studio build errors
Build failed error: cannot find symbol if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
or
cannot find symbol Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
To resolve - upgrade the compileSdkVersion and targetSdkVersion to 31 in your grade file. Note, this setting could be in one of the following files
Ionic - Capacitor config
Initialise your Capacitor config
To initialise Capacitor use the CLI questionnaire:
npx cap init
On executing the above command, you will be prompted to answer a few questions for your app such as your app's name and the package ID.
Common Ionic and Capacitor CLI's
Run the NPX commands to update the app
npm run build && npx cap sync
Run app with live reload
ionic cap run {platform} -l --external
Replace {platform} with Android or iOS depending on your environment as follows
Ionic capacitor app Xcode framework build errors
In Xcode attempting to build or run an app, I receiving a framework error.
Software / package | Version |
---|---|
Xcode | 13.2.1 |
@capacitor/cli | 3.4.3 |
@capacitor/haptics | 1.1.4 |
ionic | 6 |
@angular/core | 13.3.4 |
Angular leaflet map doesn't load tiles after refreshing the page
Working through an app project I inherited using Ionic, Angular and ngx-leaflet to name a few elements... I had a problem where the map shows only all map tiles when navigating via my app in the Xcode simulator. The simulator screen would show just a small tile and the rest of the area where the map should be visible stays in gray color.
Updating Capacitor – get and set versions
Need to know how run updates for Capacitor?
Updating Capacitor
Update Capacitor Core and CLI with the commands:
npm install @capacitor/cli
npm install @capacitor/core
Whereas, to update the relevant platforms in use:
npm install @capacitor/ios
npm install @capacitor/android