App cannot be installed: Failed to open APK (xapk)
- /e/ version: 0.19-q
- Device model(s): all
Summary
Apps is "Unable to open" and cannot extract apk due to trying to open filename with wrong file extension. App in the example is "Camera MX" (com.magix.camera_mx). Same issue as #4124 (closed).
The problem
Steps to reproduce
- search for "camera mx" in the /e/ Appstore client
- install App
What is the current behavior?
- App does not install
What is the expected correct behavior?
- App installs
Technical informations
adb logcat:
D DownloadManager: [16] Finished with status SUCCESS
...
W ziparchive: Unable to open '/storage/emulated/0/Android/data/foundation.e.apps/files/Download/com.magix.camera_mx-4.7.200 (212947200).apk': No such file or directory
E undation.e.app: Failed to open APK '/storage/emulated/0/Android/data/foundation.e.apps/files/Download/com.magix.camera_mx-4.7.200 (212947200).apk' I/O error
see the file extension .xapk instead of .apk what ziparchive is calling
host:/storage/emulated/0/Android/data/foundation.e.apps/files/Download $ ls
com.magix.camera_mx-4.7.200\ (212947200).xapk
md5sum /storage/emulated/0/Android/data/foundation.e.apps/files/Download/com*
23587d4ec7fa1cfc7dbe2b76ec4e7edd /storage/emulated/0/Android/data/foundation.e.apps/files/Download/com.magix.camera_mx-4.7.200 (212947200).xapk
cleanapk response
"_id": "5b25546e89bb692cf0e2f2f7",
"latest_version_code": 212947200,
"package_name": "com.magix.camera_mx",
"latest_version_number": "4.7.200 (212947200)",
"latest_version": "update_31",
"latest_downloaded_version": "update_31",
"name": "Camera MX - Photo & Video Camera",
"last_modified": "2021-11-14 02:57:54.155152",
..
"architectures": [
"universal"
],
the downloadlink is an xapk:
{
"success": true,
"download_data": {
"download_link": "https://apk.cleanapk.org/any_350f07542e87c93a14b37583c46936d5_com.magix.camera_mx.xapk",
...
}
}
$ md5sum any_350f07542e87c93a14b37583c46936d5_com.magix.camera_mx.xapk
23587d4ec7fa1cfc7dbe2b76ec4e7edd any_350f07542e87c93a14b37583c46936d5_com.magix.camera_mx.xapk
$ unzip any_350f07542e87c93a14b37583c46936d5_com.magix.camera_mx.xapk
Archive: any_350f07542e87c93a14b37583c46936d5_com.magix.camera_mx.xapk
extracting: com.magix.camera_mx.apk
extracting: icon.png
extracting: config.en.apk
extracting: config.arm64_v8a.apk
extracting: config.xxxhdpi.apk
extracting: manifest.json
$ cat manifest.json | jq
{
"xapk_version": 2,
"package_name": "com.magix.camera_mx",
"name": "CameraMX",
"version_code": "212947200",
"version_name": "4.7.200",
"min_sdk_version": "21",
"target_sdk_version": "29",
..
"split_configs": [
"config.en",
"config.arm64_v8a",
"config.xxxhdpi"
],
"split_apks": [
{
"file": "com.magix.camera_mx.apk",
"id": "base"
},
{
"file": "config.en.apk",
"id": "config.en"
},
{
"file": "config.arm64_v8a.apk",
"id": "config.arm64_v8a"
},
{
"file": "config.xxxhdpi.apk",
"id": "config.xxxhdpi"
}
]
}
Solutions
Workaround
Aurora or adb install
Possible fixes
I don't know anything yet about split configs - if this is an app manifest.json problem in the package or something that needs to be handled within installSplitApks()