2

I have written an app that is designed to download an .apk and install it. while the download seems to execute, the installation errors out with a parse error.

If I download the .apk manually from my repository in to the devices Download directory, I can install it without any problems.

The relevant parts of the code are at an earlier stack question I asked.

How can the same file not install when downloaded programmatically?

[SOLVED] changed download location from

var toLocation = "cdvfile://localhost/persistent/" + file;

to

var toLocation = cordova.file.externalDataDirectory + file;
Community
  • 1
  • 1
MikeB
  • 788
  • 1
  • 9
  • 27
  • 2
    Assuming that the path is still largely the same as in that answer, that is [internal storage](https://commonsware.com/blog/2014/04/07/storage-situation-internal-storage.html), and third-party apps have no rights to access files from other apps' internal storage. – CommonsWare Nov 20 '15 at 17:17
  • Tnx. That insight worked, I edited above to show the fix. – MikeB Nov 20 '15 at 22:04

0 Answers0