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:
- export gradlefile=build/org.amnezia.vpn/client/android/
- export PATH=$PATH:$gradlefile
- sudo apt-get update
- sudo apt-get upgrade -y
- sudo apt-get install wget
- sudo apt-get install openjdk-17-jdk
- cd ~/
- sudo apt-get remove cmake
- wget https://github.com/Kitware/CMake/releases/download/v3.26.0/cmake-3.26.0-linux-x86_64.tar.gz
- sudo apt-get install ninja-build
- sudo apt-get install build-essential libgl1-mesa-dev
- wget https://qtproject.mirror.liquidtelecom.com/archive/qt/6.6/6.6.2/single/qt-everywhere-src-6.6.2.tar.xz
gradle: - yes