kolbasa/cordova-plugin-apkupdater

Downloading fails with "No valid update found in download directory"

Closed this issue · 2 comments

After running:

ApkUpdater.download('http://192.168.0.12:9000/user/get_dboy_app', { onDownloadProgress: function(progress) { console.log("progreso ...", progress); } })

The download ends up with this error:

No valid update found in download directory: /data/data/driver.deliverate.io/files/update', stack: 'de.kolbasa.apkupdater.exceptions.UpdateNotFoundExc…:636)\n at java.lang.Thread.run(Thread.java:764)\n

I'm using HapiJs 14.0.0 for the API and the weird thing is that if I upload the apk to some "file upload" service it works. Do you have some guidance? This is my HapiJs code:

get_dboy_app: { handler: function(request, reply) { var filename = settings.rootPath + '/server/public/get_dboy_app.apk'; reply.file(filename, { filename: 'get_dboy_app.apk', mode: 'attachment' }); }, auth: false, tags: ['api'], id: 'get_dboy_app' }

Using the same apk route with adb install <path> works with no issues.

Never mind. I figured it out right after the question. It's important to say that the URL should have the same name as the file. My URL was:

<base_url>/user/myapk

And it should be (with extension):

<base_url>/user/myapk.zip

Regards.

Yes, that is correct. The plugin must somehow distinguish between an apk and a zip file. Right now it does that based on the file extension. I'll see if I can improve that.