Error building the metadata file

I’m trying to publich my application on F-droid,
so I created my metadata file run fdroid server commands on my linux virtual machine,
the problem when I run fdroid build command I get these errors:

shehab@shehab-virtual-machine:~/f-droid-data/metadata$ fdroid build org.amnezia.vpn
2024-05-01 14:22:01,527 INFO: Using git version 2.34.1
2024-05-01 14:22:01,528 INFO: Building version (43000) of org.amnezia.vpn
2024-05-01 14:22:01,528 INFO: Getting source for revision
2024-05-01 14:22:01,528 INFO: Repository details for build/org.amnezia.vpn changed - deleting
2024-05-01 14:23:46,599 INFO: Initialising submodules
2024-05-01 14:28:26,982 INFO: Creating file at build/org.amnezia.vpn/
2024-05-01 14:28:26,998 INFO: Creating file at build/org.amnezia.vpn/deploy/
2024-05-01 14:28:27,050 ERROR: Could not build app org.amnezia.vpn due to unknown error: Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/fdroidserver/”, line 1123, in main
if trybuild(app, build, build_dir, output_dir, log_dir,
File “/usr/lib/python3/dist-packages/fdroidserver/”, line 887, in trybuild
build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, extlib_dir, tmp_dir, force, onserver, refresh)
File “/usr/lib/python3/dist-packages/fdroidserver/”, line 414, in build_local
root_dir, srclibpaths = common.prepare_source(vcs, app, build,
File “/usr/lib/python3/dist-packages/fdroidserver/”, line 2293, in prepare_source
UnboundLocalError: local variable ‘gradlefile’ referenced before assignment

I tried to set “gradlefile” variable under the “prebuild” variable to the path to my build.gradle file and still getting the same errors


Better open a MR with the .yml file.

QT is used? You might need to build that before building the app.

okay, I opened a merge request, and also now building Qt under the “prebuild” variable instead of “build”

notice the difference in terms? pre means before building :slight_smile: you’ll need to move all the build stuff in… build: