Error occurred while copying resources/android/icon/mdpi-foreground.png

I ran into the same error in a new Ionic Capacitor@2.4.7 project. I had the splash.png and icon.png in the resources directory. But those aren’t enough. The error is related to the Adaptive Icons section for cordova-res. 2 more icons are missing in your resources directory. Add the required icon-foreground.png and icon-background.png to the resources/android … Read more

How can I align button in Center or right using IONIC framework?

You should put the button inside a div, and in the div you should be able to use the classes: text-left, text-center and text-right. for example: <div class=”row”> <div class=”col text-center”> <button class=”button button-small button-light”>Search</button> </div> </div> And about the “textarea” position: <div class=”list”> <label class=”item item-input”> <span class=”input-label”>Date</span> <input type=”text” placeholder=”Text Area”> </label> Demo … Read more

Ionic build android, Error: spawn EACCES

Got the same error today. Thanks to the comments above, here is how I fixed it. Ran: cordova build android –verbose and it showed me where it got the “Permission Denied” error… In my case it was: Running command: /usr/libexec/java_home Command finished with error code 0: /usr/libexec/java_home ANDROID_HOME=/Users/mj/phonegap/adt-bundle-mac-x86_64-20140321/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home Running command: “/Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle” -p /Users/mj/EduceMobile/app/platforms/android … Read more

Passing authorization header for images src to remote server in Ionic page

1) Create interceptor which sets authorization header import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from ‘@angular/common/http’; import { Observable } from ‘rxjs/Observable’; @Injectable() export class AuthInterceptor implements HttpInterceptor { intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { request = request.clone({ setHeaders: { Authorization: `Bearer <your token>` } }); return next.handle(request); } } Instead of <your token> you … Read more

Ionic 5 with Angular 9 – Angular JIT compilation failed: ‘@angular/compiler’ not loaded

Updated & correct solution to fix this Based on the answer from Tran Quang, I went to see the CHANGELOG.md of ionic-native and came to know that they recently updated their package to compile with Angular 9. Hence you need to update any/all dependencies of @ionic-native. For this, look at all the dependencies in your … Read more

Ionic 5 – How to replace default icon and splash screen image and generate resources

Automatic icon and splash screen resizing CLI tool for Capacitor based applications. It automatically resizes and copies your icon.png and splash.png files to platform dedicated directories. It does NOT require any external binary libraries. Javascript only. Installation $ npm install capacitor-resources -g Usage Required files Add your icon.png (1024×1024 px) and splash.png (2732×2732 px) files … Read more