I am looking to enable download and installation of an android application package (APK) from my own server through a browser download. This appears to be blocked in the latest versions of android with the cryptic "There was a problem parsing the package" message. In the past (I forget which version of android) this worked just fine. Need help making it work in Android 11.
Here is the header content used to serve the file:
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.android.package-archive');
header("Content-Disposition: attachment; filename=\"".$filename.'"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($androidPackage));
Additionally, the MIME for APK files on the server is set to application/vnd.android.package-archive
The parse error occurs on the following phone configuration: Samsung Galaxy S10 on Verizon network Android version 11 (API 30) APK Build Target 28, Min 21
I have enabled special access:install unknown apps for the browsers.
The application still won't install from a browser (pointing to my server's website).
I have been able to upload the apk file to google drive and install from there (after permitting google drive to install unknown apps), so it does not appear to be a problem with the APK file, but a browser permissions problem.
I'm also able to install it to my local device using developer debugging.