Fdroid build gradle error

I tried to prepare a merge request to add an app to fdroiddata, however running “fdroid build -v -l packageName” ends with the following:

DEBUG: > gradle clean
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.4.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.ExceptionInInitializerError (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
ERROR: Could not build app io.timelimit.android.open: Error cleaning io.timelimit.android.open:0.1.0
==== detail begin ====
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.4.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.ExceptionInInitializerError (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
==== detail end ====
INFO: Fertiggestellt
INFO: 1 Build fehlgeschlagen

When going into the temp directory and running “./gradlew clean” it works. What am I doing wrong?

(config file: https://gitlab.com/l-jonas/fdroiddata/commit/9fc43591b687a49997e06c4ba81356132d6ada3a)

Builds fine for me :wink:

But it’s still interesting why it does not work for me. It could be a bug which could affect other “users” too. I already tried deleting $HOME/.gradle and it did not help.

How do you install gradle?

I use https://sdkman.io/

I installed the package “fdroidserver” from Debian unstable and Android Studio from https://developer.android.com/studio/ (an older version and I used the integrated updater). My Android SDK installation was made by Android Studio. I am not sure which of them contains gradle.

Kinda none, the Studio downloads them but for itself as needed.

Try the one I linked.

I found out from where I got gradle:

https://f-droid.org/en/docs/Installing_the_Server_and_Repo_Tools/#debianubuntumintetc recommends sudo apt-get install fdroidserver on Debian
which installs gradle (https://packages.debian.org/sid/fdroidserver lists gradle as suggestion). Due to that, I manually removed this suggestions:

$ sudo apt remove android-sdk gradle
$ sudo apt autoremove

Then, it still did not work:

INFO: Scanning source for common problems...
INFO: Removing gradle-wrapper.jar at gradle/wrapper/gradle-wrapper.jar
INFO: Creating source tarball...
ERROR: Could not build app io.timelimit.android.open due to unknown error: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/fdroidserver/build.py", line 1120, in main
    options.onserver, options.refresh):
  File "/usr/lib/python3/dist-packages/fdroidserver/build.py", line 896, 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 562, in build_local
    tarball.add(build_dir, tarname, exclude=tarexc)
TypeError: add() got an unexpected keyword argument 'exclude'

INFO: Fertiggestellt
INFO: 1 Build fehlgeschlagen

So I removed fdroidserver using apt:

sudo apt remove fdroidserver
sudo apt autoremove

Then I used https://f-droid.org/en/docs/Installing_the_Server_and_Repo_Tools/#installing-the-latest-code-any-platform:

sudo apt install python3-venv
pyvenv fdroidserver-env
. fdroidserver-env/bin/activate
pip3 install fdroidserver

And it still does NOT work (same error as above).

Some ideas,

  • it’s the same metadata as linked (that build fine for me) or you’ve modified it?
  • I use git clone ...fdroidserver and always run <path>/fdroidserver/fdroid for the commands, I don’t care for install
  • fdroidserver from distro repo is rather old

Thanks for your ideas (although they did not help), I got it working now.

Applying the changes from https://gitlab.com/fdroid/fdroidserver/commit/7bdffde804534147eb835a6fd51e5c14d271379d in the version which was installed fixed it. However, this commit is 5 months ago, so I don’t understand why the older version/ version which did not contain it was installed.

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