My apk file format is like this:
xxxx-debug.apk
xx-xxx-debug-xxx-1.0.1.apk
I can download the apk files but I cannot install them. I'm facing the following error:
Parse error
There was a problem while parsing the package.
Code used for Installation:
protected void install(String fileName) {
Intent install = new Intent(Intent.ACTION_VIEW);
install.setDataAndType(Uri.fromFile(new File(fileName)),"application/vnd.android.package-archive");
startActivity(install);
}
When the apk file are downloaded, a number is appended at the end of the file e.g. some.apk
becomes some-1.apk
.
What I have tried/checked so far:
- check on the option “Unknown sources.”
- uses-permission
android:name="android.permission.INSTALL_PACKAGES" tools:ignore="ProtectedPermissions"
- android device version is 5.0.1
- apk files are not corrupted because I've managed to install it in a different way