1

In the answer to this question I specifically discovered that I could not install the VLC nightlies. It had nothing to do with that answer, which was on a question about which version of VLC was right for that device. But that question was in fact inspired by this problem: I never previously had an APK I couldn't install by merely downloading, when I am in the Android Web Browser, and it downloads the APK, I can click on it in the notification applet at the top. When I do, it says

Can not open file

When I open that file up with the LineageOS Files Manager, com.android.documentsui I get the same error. Now, I'm wanting to know what specifically is borked about just the VLC packages? Does anyone else get this problem? Why is that pm install ./appname.apk in the shell works, but the GUI doesn't?

I'm using LineageOS 14.1-20180616, based on Android 7.1.2.

  • 1
    Have you allowed installing from unknown locations in the settings menu? – Ankush Jun 18 '18 at 22:10
  • @Ankush yep, it worked for installing probably tens of apks, this is some kind of problem that I'm kind of sure is either specific to the apk being malformed, or to filemanager, or the apk-parsing library. Don't know where to start except to say, I installed f-spot through the browser just fine. I don't think the browser/file manager is spawning right to pm, because that works. – Evan Carroll Jun 18 '18 at 22:12
  • It is possible that the content/media type for the apk file is set wrong, so the file manager does not know the type of the file (as in it may be ignoring the extension, and relying solely on the media type (application/vnd.android.package-archive). – Ankush Jun 18 '18 at 22:14
  • 1
    I would try another file manager just to be sure, then file as a bug. I can't try to install it on my device, as my phone does not have an ARM processor. – Ankush Jun 18 '18 at 22:27
  • 1
    @Ankush figured it out and self-answered. – Evan Carroll Jun 19 '18 at 3:05
1

Installing

With the LineageOS File Manager

It seems that inside the File Manager, there are two discrete things Download a directory, and Downloads some broken nonsense shortcut link:

  • Does not work: On the left nav, you'll see Images Videos Audio Recent, and then Downloads Documents, and SM-P600. Installing from the Downloads on the right bar, gives this error.

  • Works: Going into the device at the bottom of the left nav (which is actually just a link to /data/media/0 and then clicking on Download will take you Download which is actually different from Downloads (plural and on the Left Nav). From this you can install the APK.

With the CLI

  • Enable ADB in the Settings
  • Run adb shell on the host
  • Browse to /sdcard/Downloads or /data/media/0/Download with cd. If you're unsure where the apk is located try running

    find / -name 'VLC*-ARMv7.apk
    
  • Locate the apk and install with pm

    pm install ./VLC*-ARMv7.apk
    

The problem

The problem seems to be that VLC web server answers the request with a response that has content-type: application/octet-stream like this,

$ curl -s -I "https://nightlies.videolan.org/build/android-armv7/VLC-Android-3.0.11-20180618-0249-ARMv7.apk" 
HTTP/2 200 
server: nginx/1.15.0
date: Tue, 19 Jun 2018 03:16:06 GMT
content-type: application/octet-stream
content-length: 25048251
last-modified: Mon, 18 Jun 2018 06:05:02 GMT
etag: "5b274b8e-17e34bb"
accept-ranges: bytes
x-clacks-overhead: GNU Terry Pratchett
strict-transport-security: max-age=31536000

Rather than application/vnd.android.package-archive. This means that you can't install through the browser, or the Downloads shortcut. This is because APK files are just zip files:

$ file VLC-Android-3.0.11-20180618-0249-ARMv7.apk 
VLC-Android-3.0.11-20180618-0249-ARMv7.apk: Zip archive data, at least v2.0 to extract

So what the File Manager and browser are trying to do is open them as such -- and you don't have something that hands Zip archive data 2.0+

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.