Android: Running ./gradlew --no-daemon causes a java exception after the build is supposedly finish

Created on 1 Nov 2017  路  6Comments  路  Source: nextcloud/android

I'm running this: ./gradlew clean assembleGenericRelease --no-daemon

And the build ends with

BUILD SUCCESSFUL in 59s
30 actionable tasks: 29 executed, 1 up-to-date
Exception in thread "Thread-36" java.lang.NoClassDefFoundError: com/android/utils/PathUtils$1
        at com.android.utils.PathUtils.deleteIfExists(PathUtils.java:47)
    at com.android.utils.PathUtils.lambda$addRemovePathHook$0(PathUtils.java:125)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.android.utils.PathUtils$1
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 3 more

(no problem running it withput the daemon flag)
I'm trying to disable all unneded gradle features because I'm currently trying to run the nextcloud build through reprotest.

I think this error even if it's output after the build is supposed to succeed is blocking a successfull build under reprotest.

FYI: F-Droid tries reproducing builds here: https://verification.f-droid.org/ nextcloud still has apparently some issues I'm trying to get to the bottom of.

bug needs infdiscussion

Most helpful comment

I believe this is a bug in the Android Plugin for Gradle and have filed a bug with Google: https://issuetracker.google.com/issues/69380617

All 6 comments

Okay, this is probably not the reason for the issue I'm facing right now. And it might after all be a gradle issue, but I've used this option successfully for other apps. (albeit with different gradle versions)

So please close this if you think this is not relevant to what you are doing in the nextcloud app.

I tried it with latest master and it is working quite fine for me on (gentoo) linux.

because I'm currently trying to run the nextcloud build

Which features did you disabled? Maybe it is related to this.

com/android/utils/PathUtils

seems to be a android and not nextcloud specific file.

I tried it with latest master and it is working quite fine for me on (gentoo) linux.

Interesting. I'm on ubuntu 17.04, I also tried master.

Which features did you disabled? Maybe it is related to this.

I ran with this options additionally:
--no-build-cache --no-search-upward --offline -d --no-daemon

With these options it also working for me.
Maybe you can try to use gradle directly instead of ./gradlew?

Using gradle directly makes no difference, neither does using gradle 4.3

No idea where the problem lies really... but it's very unlikely that's it's nextclouds fault. So closing this.

@tobiasKaminsky Thanks for helping out.

I believe this is a bug in the Android Plugin for Gradle and have filed a bug with Google: https://issuetracker.google.com/issues/69380617

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tobiasKaminsky picture tobiasKaminsky  路  3Comments

toobie83 picture toobie83  路  3Comments

JSoko picture JSoko  路  3Comments

ezaquarii picture ezaquarii  路  3Comments

AndyScherzinger picture AndyScherzinger  路  3Comments