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 4.3.0.0 (43000) of org.amnezia.vpn
2024-05-01 14:22:01,528 INFO: Getting source for revision 4.3.0.0
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 local.properties file at build/org.amnezia.vpn/local.properties
2024-05-01 14:28:26,998 INFO: Creating local.properties file at build/org.amnezia.vpn/deploy/local.properties
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/build.py”, line 1123, in main
if trybuild(app, build, build_dir, output_dir, log_dir,
File “/usr/lib/python3/dist-packages/fdroidserver/build.py”, 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/build.py”, line 414, in build_local
root_dir, srclibpaths = common.prepare_source(vcs, app, build,
File “/usr/lib/python3/dist-packages/fdroidserver/common.py”, line 2293, in prepare_source
gradlefile)
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

prebuild:

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:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.