kolbasa/cordova-plugin-apkupdater

Getting error after downloading apk - Download directory is empty

Closed this issue · 5 comments

Hi,

I am trying to get this plugin to install updates from S3 and Github.

  1. I am facing a problem with S3 when receiving the files. It says File not found error. If needed I can give more information on this. I would suspect its not direct File that can be received from a S3 URL. Let me know if I am wrong.

  2. I am getting the data properly from a Github URL and things work. I am able to see the download progress as in the screenshot. But after the download is compelte, I see the error Directory is empty. I thought the reason could be no write access and I have given <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> as well.

I might be missing something vital but I couldnt figure it out. Please let me know what I can do.

image

This is what it looks like for me when I download from Github. After the download an info of the downloaded apk should appear.

await ApkUpdater.download("https://raw.githubusercontent.com/kolbasa/cordova-plugin-apkupdater-demo/master/Demo.apk", {onDownloadProgress: console.log});

image

Are you downloading an apk file or a zip file?

The error message is somewhat misleading. It does not mean that there is nothing in the download folder, but that no "*.apk" file was found. Therefore, it would be interesting to know what exactly is being downloaded.

(I should improve this behavior :D).

Thanks a lot. Indeed, my github url was wrong. Instead of raw content url, I had given the actual blob url which was the issue. Now I am able to see the alert to install the update, but it ends up saying 'App not installed'.

The version, version code everything is incremented. Its a newly genereated APK with same keys used.

Try to install the update manually with adb install update.apk.
This should tell you why the update could not be installed. Often it is a problem with a changed signature.

Unfortunately, the plugin itself cannot catch the error so easily.

Ohh sure I will try that. Thanks. for the help. I will close the issue for now, but if I figure it out, will post it for reference.