Mot-clé - development

Fil des billets - Fil des commentaires

vendredi 1 mars 2019

Ionic file upload issue on iOS

The fileTransfert variable must be initialize in the platform.ready().then() method.


import { FileTransfer } from "@ionic-native/file-transfer";
import { Platform } from 'ionic-angular';

...

private fileTransfer: FileTransferObject;

...

constructor(public transfer: FileTransfer, public platform: Platform) {
    this.platform.ready().then(
     (ready)=>{
       this.fileTransfer= this.transfer.create();
     }
   );
}

Cordova gradle issue

when you change gradle version for example after Android ask you to update it

You have several choices:

  • remove and reinstall android platform. :(
  • define a path to the new gradle with an environment variable :)
export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https://services.gradle.org/distributions/gradle-4.10-all.zip