Piashsarker/AndroidAppUpdateLibrary

Download goes into minus

Closed this issue · 29 comments

While downloading the update ,download goes till 50% or 65% and then goes into minus like -65% and decreases to 0 again.

thanks for your issue, will look into it.

@MudassirMobi Did you just download the original library code and test it in the sample app?

@cyb3rko Let me do the same .

Hmm, weird.
Does the download fail or does it download?
I will have to try to implement the library in an own app because since now I just worked directly on the library code.

App was not working than I have added this line of code in Application tag in Manifest file
" android:requestLegacyExternalStorage="true" " ,for android 10 in your project. And then it works, It gets download, but the progress bar showing nagative values as well ,which is my main concern.

Ah, so it was the problem with Android 10 okay.
Yeah, adding this line is the much easier way of installing apps on Android 10 or higher, but it's not good practice.
I have not tested it yet on Android 10, I will do it as well and see if I can solve that problem, thanks!

At some point we will add installer for Android 10.

I just added System.out.println(progress[0]); in ProgressUpdate of the AsyncTask and ran the app. It just prints out the numbers from 0 to 100.
For me everything seems to work. You can do it too and see what gets printed.

That's very weird.
I'm just using the code from the master branch.
I also added a Kotlin version of this library (#10), this code also works.

Does it try to install the app or does it not trigger the installation process?

The problem why the installation fails is because the update is on the same version so you can't update it so I built a new apk:
https://cdn.cyb3rko.de/Apps/testUpdate.apk

What worked? Was the progress shown or did the update succeed?
It's currently stored on my server.

I think I will try using the DownloadManager and see if it works better. I'm gonna open a new branch in my forked repo.
I will notify you here if I did it.

Cool,Thanks .

Awesome. Then just open a pull request to fix it for others too.

@MudassirMobi Or should I do that?

@MudassirMobi I hope my fix works (see #11)