"OSError: [Errno 8] Exec format error" when try fdroid update


Hi, I have a problem with fdroidserver v1.0.8 running on debian jessie.
Edit: Tried with fdroidserver v1.0.0, the problem is the same.
Without any apk in repo, fdroid update runs succesfully, but wen i put some apk-s to repo i get this error:

fdroid update -v
DEBUG: Reading ‘config.py’
DEBUG: Processing openvpn-connect-3-0-5.apk
CRITICAL: Unknown exception found!
Traceback (most recent call last):
File “/usr/bin/fdroid”, line 164, in
File “/usr/bin/fdroid”, line 159, in main
raise e
File “/usr/bin/fdroid”, line 138, in main
File “/usr/lib/python3/dist-packages/fdroidserver/update.py”, line 1946, in main
apks, cachechanged = process_apks(apkcache, repodirs[0], knownapks, options.use_date_from_apk)
File “/usr/lib/python3/dist-packages/fdroidserver/update.py”, line 1473, in process_apks
use_date_from_apk, ada, True)
File “/usr/lib/python3/dist-packages/fdroidserver/update.py”, line 1346, in process_apk
apk = scan_apk(apkfile)
File “/usr/lib/python3/dist-packages/fdroidserver/update.py”, line 1053, in scan_apk
scan_apk_aapt(apk, apk_file)
File “/usr/lib/python3/dist-packages/fdroidserver/update.py”, line 1103, in scan_apk_aapt
p = SdkToolsPopen([‘aapt’, ‘dump’, ‘badging’, apkfile], output=False)
File “/usr/lib/python3/dist-packages/fdroidserver/common.py”, line 2109, in SdkToolsPopen
config[cmd] = find_sdk_tools_cmd(commands[0])
File “/usr/lib/python3/dist-packages/fdroidserver/common.py”, line 392, in find_sdk_tools_cmd
File “/usr/lib/python3/dist-packages/fdroidserver/common.py”, line 400, in test_aapt_version
output = subprocess.check_output([aapt, ‘version’], universal_newlines=True)
File “/usr/lib/python3.4/subprocess.py”, line 607, in check_output
with Popen(*popenargs, stdout=PIPE, **kwargs) as process:
File “/usr/lib/python3.4/subprocess.py”, line 859, in init
restore_signals, start_new_session)
File “/usr/lib/python3.4/subprocess.py”, line 1457, in _execute_child
raise child_exception_type(errno_num, err_msg)
OSError: [Errno 8] Exec format error

How can i fix this error?

System: Debian 8 Jessie
Fdroidserver: v1.0.8
Android sdk:

  • build-tools: v28.0.1
  • platforms: v28


My guess is that you’re using the latest platform with an old fdroidserver.

Can you try to clone fdroidserver from git and use that instead?


Seems like something is wrong with the version of aapt that fdroid update found. Try setting a specific version with either build_tools = ... or aapt = ... in config.py. If that fails, try running aapt dump badging openvpn-connect-3-0-5.apk from the terminal.