Downloading with File Transfer nothing happens

i want to download a file and run it on android. but nothing happens when i use File Transfer download in --prod mode. even no errors!

constructor(public transfer: FileTransfer, private file: File, ...){}

download(){
const fileTransfer: FileTransferObject = this.transfer.create();
this.platform.ready().then(() => {
                    console.log('trying to update the application. . .');
                    let url = 'some url';
                    fileTransfer.download(url, this.file.externalDataDirectory + '/AzManCheKhabar.apk').then((entry) => {
                      console.log('download complete: ' + entry.toURL());
                    }, (error) => {
                      // handle error
                      console.log('download error: ' + error);
                    });
}
1 Like

just moved

const fileTransfer: FileTransferObject = this.transfer.create();

in the platform.ready() !! and solved the problem. now problem is that i can not install the downloaded apk.
it openes the file and its the exact same apk installed on my device… but it says

there was a problem while parsing the package

1 Like

:frowning: now that i found the problem i’m even more sad! the downloaded file is less than 1KB ! but the file is just fine in the url. i even downloaded it from phone browser and installed it successfully … will report any success with the problem … if any

only missing the s! for https in the url