Android 无法从浏览器下载安装 APK
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3253079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't install APK from browser downloads
提问by Johnny
I've downloaded an APK from web, using the default browser and it can't be opened from the Browser -> Downloads.
我使用默认浏览器从 Web 下载了一个 APK,但无法从浏览器 -> 下载中打开它。
It tells me "Can't open file"
它告诉我“无法打开文件”
But I can use a file browser (like OI File Browser) to browse and open this APK, and it works well.
但是我可以使用文件浏览器(如OI File Browser)来浏览和打开这个APK,而且效果很好。
What could be the problem here? Is it about the HTTP header?
这里可能有什么问题?与 HTTP 标头有关吗?
采纳答案by dxh
It shouldn't be HTTP headers if the file has been downloaded successfully and it's the same file that you can open from OI.
如果文件已成功下载并且它与您可以从 OI 打开的文件相同,则它不应该是 HTTP 标头。
A shot in the dark, but could it be that you are not allowing installation from unknown sources, and that OI is somehow bypassing that?
在黑暗中拍摄,但可能是因为您不允许从未知来源安装,而 OI 以某种方式绕过了它?
Settings > Applications > Unknown sources...
设置 > 应用程序 > 未知来源...
Edit
编辑
Answer extracted from comments which worked. Ensure the Content-Type is set to application/vnd.android.package-archive
从有效的评论中提取的答案。确保 Content-Type 设置为 application/vnd.android.package-archive
回答by swxxii
I had this problem. Couldn't install apk via the Downloads app. However opening the apk in a file manager app allowed me to install it fine. Using OI File Manager on stock Nexus 7 4.2.1
我有这个问题。无法通过下载应用安装 apk。但是,在文件管理器应用程序中打开 apk 可以让我安装得很好。在库存 Nexus 7 4.2.1 上使用 OI 文件管理器