Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Robert_T_1
Beginner
273 Views

APK's downloaded from emails are not working

All of my apps fail to install from the email sent by the XDK. When I click the downloadead file it says "Can't open file".
I'm not sure if this is true for the x86 version, but if I download the ARM APK directly from the XDK and install - it works.

I recently upgraded to the latest version (3088), and it worked fine for a few days.
This issue started a few days after upgrading (on Tuesday 05 Apr 16) for no apparent reason.

It applies to all apps - some with lots of plugins, some without any. It's not an app code issue, it's an XDK bug.

I posted this comment originally on Wednesday (06 Apr 16) and now I can't find that post. It seems to have been removed.

Tags (2)
0 Kudos
19 Replies
Robert_T_1
Beginner
273 Views

I've done some more research into this and the results are very strange...

If I download any of my ARM APK's from the link in the XDK email, it fails every time. It just says "Can't open file".
It does download the file, but the file size is different from when I download it to my PC.
I've tried different browsers and email clients on the phone, but it never works.

However, if I download the zip, or the direct link on to my computer, then download to my phone from my localhost it does work.

Also, strangely, if I copy the file that wont install from my phone to my PC, then download it via my local host, it works!!!

This must be an issue with the code that launches the download in the email.
I'm almost certain that it is a bug in the code that launches the download (specifically from mobiles) which is not adding the correct file size in the header.

Is anyone else experiencing this issue?

Is the form the best way to raise this issue, or can I inform you (XDK admin) directly?

Thanks

Pamela_H_Intel
Moderator
273 Views

Robert,

The forum is the best way to raise an issue. For one, those of us on the XDK team can contact the appropriate team members to resolve problems once we get enough information. And second, we are more likely to find out if others are having this problem when we talk about it here.

You could be right. There could be an issue with the XDK. But I wonder, because I have not heard of anyone else having this problem, could it be something was removed from your phone? Are you testing on only one device? If so, was that device recently upgraded? Or changed?

It doesn't sound like a build setting since you can copy the file from your phone to your PC and back, and then it works. Please clarify this - you say the apk will not download on your phone, but then you say that you can copy it from your phone to your PC? Or is it that the failure is in installation, not a downloading issue?

Pamela

PaulF_IntelCorp
Employee
273 Views

Robert, there are two different ways to send an email from the builder:

  1. the automatic email that is sent to the email address registered to your XDK account
  2. the "share this app" email that you can send from the build tab (see the image below)
    Screen Shot 2016-04-12 at 7.32.09 PM.png

Which one are you talking about? The 1st or the 2nd? I always use the 2nd to install onto my devices and have not had any issues, and I download both ARM and x86 APK files. The 1st requires that you are logged into your account to download the link. The 2nd does not.

Robert_T_1
Beginner
273 Views

Hello, thanks for your reply.

I tried your initial suggestion (renaming the app) which didn't work.
I use the email link in the build window as per your screenshot.

It doesn't seem to be a bug specifically associated with 1 app.
All of my apps have the same problem - installing the ARM APK from the email doesn't work.

As I said before, downloading the APK to my PC, then installing on the phone works.
If I download to my phone from the email, it fails to open the file, but if I then transfer it to my PC and back to my phone again it works!

This is why I think it must be a bug in the download code, specifically the file size in the header.
If the file size in the header doesn't match the actual file size, it causes problems.
When re-downloading from my local host, the file size in the header is sent correctly, and it works.
I'm only speculating, but my suspicion does account for this behaviour.


Any help would be greatly appreciated.

I'll try uninstalling the XDK and reinstalling and let you know if that helps.

Thanks

Pamela_H_Intel
Moderator
273 Views

I tried your initial suggestion (renaming the app) which didn't work.

Not rename the app, Change the AppID in Build Settings.

Anjan_L_
Beginner
273 Views

I am facing the same issue. APK file downloaded from email not working. says 'can't open file'.

thanks.

Robert_T_1
Beginner
273 Views

I've tried renaming the app id, renaming the app, building a different app, and building a completely new app.

An important point about this is that the file will not install from the email link unless I transfer it from my phone to my PC and back again. In other words there's nothing wrong with the apk, but something happens to it when I move it to PC and back - probably the file size attribute.

The file size on the phone changes after I move it to my PC and back again.

I suggested previously that its an issue with the download page - it's probably not setting the correct file size in the header.

Thanks again

PaulF_IntelCorp
Employee
273 Views

Thanks for the additional info, Robert. I'll ask Pamela to file a bug on this one, very strange behavior. We're not seeing it on our devices.

Pamela_H_Intel
Moderator
273 Views

@Anjan - are you still unable to run the build? If you are using the secure link you need to be logged in to XDK. Try using the public link (use the share link in the build window to email yourself - that will email a non-secure version to whatever email address you provide).

@Robert - we have not been able to replicate this issue. Are you using the secure link that is emailed automatically, or have you also tried using the public link that you can email to yourself via the share link on the build page?

Robert_T_1
Beginner
273 Views

Hello. Unfortunately it's the same situation for all of my projects.

I uninstalled, renamed my apps, upgraded to the latest version and even tried the Early Access version.
I've tried all of the links in the email, and none of them work on Android.

To be totally clear - the APK files do not install when downloaded to my phone, but if I move the file to a different location on my device, it installs fine. I only have 2 Android devices, both with ARM processors. 1 is Android 4.2, the other is 5.1. The same thing happens on both phones, and used to work fine on both until about a month ago.

Perhaps the only way for you to investigate is if I send you the link. Then you can see the problem and test it for yourself.
It's not a huge issue on Android as the APKs can be freely distributed manually to my clients.

But for iOS I notice that the install links expire very quickly, sometimes as quickly as half an hour after building and emailing the iOS link.
Do you know why that is happening?

Thanks

PaulF_IntelCorp
Employee
273 Views

Robert -- I confirmed with engineering that there is a problem with the iOS OTA links that results in the link only working for 30 minutes following the start of the build. That is a bug, it should be good for 30 days. They are working on a solution to this problem, thank you for pointing that out.

In the case of the APK install problems, please respond to my PM with some links so we can see if we are able to reproduce what you are describing.

Robert_T_1
Beginner
273 Views

Hi, great news. Looking forward to longer lasting iOS links!

For the APK issue I have responded to your PM. Thanks for that.

Is there a place where I can report bugs. I've found a few minor bugs and I also have some suggestions for features in future releases.

Cheers

PaulF_IntelCorp
Employee
273 Views

Robert -- thanks for those links. I cannot even download a file with them! I get some very strange error messages that I showed to the appropriate engineering folks and they were surprised to see that error. There are a few theories regarding what may be going on. I'm going to file a bug and will provide the engineer in charge with your forum email address, in case he needs to contact you; or he may simply contact you via this thread.

Erik_J_Intel
Employee
273 Views

Hi Robert,

I'm sorry about your troubles downloading files on your device - I'm the one that generates those URls so I'm trying to figure out what I'm doing wrong. I have a few theories, none of which are very good but hopefully one of them will get you unstuck:  

First, others on the Internet have experienced "Cannot open file" problems when downloading APKs onto Android.  These threads suggest that it is a limitation of the Android browser.  Namely, even with the "Allow untrusted apps" setting in Android, one must launch the app using the file manager and not the download manager of the browser.  Paul was able to demonstrate this behavior on his Android device.  In short, can you try to download the APK and then launch the app using the file manager and not the browser?  (http://stackoverflow.com/a/14048742) ;

Second, another thread indicated that on older Android devices the built-in browser might not be getting security updates and might not understand the modern SSL certificates/handshakes required by our download links.  If you are not already doing so and it is possible, one suggestion would be to try to use Chrome on your device instead of the built-in browser.

Third, Paul demonstrated that if he had the x86 version of an app installed on his Android device and then attempted to launch the ARM version (using the file manager), that Android failed to launch the app.  He had to uninstall the x86 version from his device before being able to successfully lanuch the ARM app.  And yes, the ARM app is smaller than the x86 app.

Fourth, and finally, we tried copy/paste for your links and then emailing them to ourselves.  In one situation, the paste operation added in a space (represented by a %20 in the url).  This space breaks the URL.  While I don't think you are doing this, if you are copy/pasting these URLs, be wary of extra spaces.  I can't say why this space was added, but I have a weak theory that since some of these URLs are just slightly longer than 1024 characters that might cause the copy/paste or email client to insert a space.  I know, I'm stretching. 

For the first three ideas I can't do much from my end, but, if we find the length of the URL is the culprit I can think about potential solutions.  We will keep looking and thanks for any more information that you learn.

erik

Robert_T_1
Beginner
273 Views

Hi. I've just read through your suggestions.

I don't think any of your suggestions explain the behaviour I'm experiencing.

I've tried this on 2 devices, both ARM, 4.2 and 5.1.

The same thing happens if I download the link from the gmail app, gmail in chrome or hotmail in chrome.

However, if I download the apk from my local webserver it's fine.

On that basis I'm pretty sure its a problem with your download code.

I have an Android 6.1 device arriving soon, so I'll check with that and see if it's the same.

Another thing worth noting is that downloading and installing did work for about 2 months, then suddenly stopped working on both of my devices.

Thanks for your help so far.

Rob

PaulF_IntelCorp
Employee
273 Views

Thanks, Robert. Please post additional data as you have it available. The thing that's confusing is that we've gotten no other reports of problems like this from anyone else.

Paul_J_1
Beginner
273 Views

We are experiencing this problem beginning with our Android build this morning. Everything had been working fine.

We are using XDK build 3522.

If we try to open the downloaded apk file on our test device, we get the error message "Can't open file".

We downloaded an apk installer app and the apk installed just fine, It just won't open from the Download Manager.

Paul_J_1
Beginner
273 Views

After investigating a little more, it seems unlikely that the problem is caused by the XDK.

The downloaded APK is not corrupt, as it can be installed using either the File Manager, or an APK Installer app.

For some reason, trying to open the same APK from the Download Manager doesn't seem to work.

PaulF_IntelCorp
Employee
273 Views

If you try to open a shared link to an APK that is more than seven days old it will not work. There is a seven day timeout on those links.

Reply