Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error after downloading apk - Download directory is empty #28

Closed
VigneshVaidyanathan opened this issue Aug 5, 2021 · 5 comments

Comments

@VigneshVaidyanathan
Copy link

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

@kolbasa
Copy link
Owner

kolbasa commented Aug 5, 2021

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?

@kolbasa
Copy link
Owner

kolbasa commented Aug 5, 2021

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).

@VigneshVaidyanathan
Copy link
Author

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.

@kolbasa
Copy link
Owner

kolbasa commented Aug 5, 2021

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.

@VigneshVaidyanathan
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants