Closed licaon-kter closed 10 months ago
Thanks for letting me know. So the change to Java17 came via Fdroid env?
BUILD FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:mergeReleaseJniLibFolders' (type 'MergeSourceSetFolders').
- Gradle detected a problem with the following location: '/builds/fdroid/fdroiddata/build/com.github.catfriend1.syncthingandroid/app/src/main/jniLibs'.
Reason: Task ':app:mergeReleaseJniLibFolders' uses this output of task ':syncthing:buildNative' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
1. Declare task ':syncthing:buildNative' as an input of ':app:mergeReleaseJniLibFolders'.
2. Declare an explicit dependency on ':syncthing:buildNative' from ':app:mergeReleaseJniLibFolders' using Task#dependsOn.
3. Declare an explicit dependency on ':syncthing:buildNative' from ':app:mergeReleaseJniLibFolders' using Task#mustRunAfter.
Please refer to https://docs.gradle.org/8.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/8.0/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2m 58s
18 actionable tasks: 18 executed
==== detail end ====
2023-11-07 08:56:48,476 DEBUG: Error encountered, stopping by user request.
Uploading artifacts for failed job
00
You want Java 17: https://github.com/Catfriend1/syncthing-android/blob/main/gradle/wrapper/gradle-wrapper.properties#L4 as Gradle 8 needs 17 ;)
Do I have to set this in my files or fdroiddata?
Set what?
Are we lost in translation?
After you upgraded to Gradle 8, you app needs Java 17, if you use AS I guess that happens behind your back, for F-Droid we added 4 lines in the recipe.
Now, about the error?
After you upgraded to Gradle 8, you app needs Java 17, if you use AS I guess that happens behind your back
Correct. I remember that I needed to uninstall jdk 11 from my computer. Pointed my JavaHome env var to Android Studio's jbr java dir.
we added 4 lines in the recipe.
Okay, I checked that and it seems fine. Thanks.
So according to the error message above, it seems I have a dependency problem/step order problem in my build.gradle . Will check during my next dev session how to fix this. I'm just wondering why my Windows based build worked fine with gradle 8 and the existing build.gradle. maybe some weird gradle specific stuff that came with upgrading gradle (...)
Maybe try to clean up your local gradle/whatever cache and retry to build?
@licaon-kter Why is it calling gradlew with both "buildNative assembleRelease" according to the log ( ref https://gitlab.com/fdroid/fdroiddata/-/jobs/5475535486#L619 ) ?
buildNative is configured as a single and first step in fdroiddata yml...
@licaon-kter Could you please retry to build from this tag: https://github.com/Catfriend1/syncthing-android-fdroid/tree/v1.26.0.2
The command gradlew :syncthing:buildNative assembleDebug
now succeeds on my Windows machine.
Thank you too :-)
@licaon-kter
In https://monitor.f-droid.org/builds/log/com.github.catfriend1.syncthingandroid/1260002#site-footer I am missing the "buildNative" step. I think this is a non functioning APK without the Syncthing Binary that has been built? But why?
Ah okay now I see in the above linked commit buildNative was removed. That should be the culprit. I suggest we put it back and rebuild before users get affected?
I've removed it: https://gitlab.com/fdroid/fdroiddata/-/commit/dc1d75ade2d12d76ed673dfe8a60b34d8dae4868
Because when you said:
Why is it calling gradlew with both "buildNative assembleRelease" according to the log ( ref https://gitlab.com/fdroid/fdroiddata/-/jobs/5475535486#L619 ) ?
I understood it as "this is wrong"
Then, reading https://github.com/Catfriend1/syncthing-android/blob/3b78c7263df2c33a8bf70fd01bd8c27819ad5492/app%2Fbuild.gradle it looked (in my un-dev eyes) like you are going to call this from gradle so the extra .yml step was unnecessary.
Also, the build succeeded, which is rather baffling to me... it should fail if its deps are not there as needed. :(
The apk was built, and we are in the sweetspot of the cycle where we can still remove the faulty APK, so we did. :)
I'll amend the recipe asap.
@licaon-kter Thank you. So this was just a misunderstanding and now solved. I must admit I got used to the two step build process as it always had been from the beginning, so doing buildNative first and then then the main app build 🙂. I also wonder , because gradle wanted the dependency defined but now does not fire the task when it never ran before. 🤷♂️
re-added via https://gitlab.com/fdroid/fdroiddata/-/commit/e30a9c339e5d47f9aca6a8e8f4ef6cc16678c8bc
But please add a fail mode for this during build
hmm we're back at square 1: https://gitlab.com/fdroid/fdroiddata/-/jobs/5525083301#L3743
I'll try something else locally, brb
Hmm, I could reproduce the problem on windows before I fixed it. Interesting, that it now returned with the preassemble in place. 🤷♂️
It's running now with this change that I've done to your upstream: https://gitlab.com/fdroid/fdroiddata/-/commit/4cea94a0b8251d914ba0152a1812729d5064b057#bdbd642de47f8b99c9954756fdff27dc60ec9b7f_2052_2057
Can we try this for the fork, please? Do I also need to adjust something on my github repo?
Was waiting for the build locally, the APK has the libs/.so hence: https://gitlab.com/fdroid/fdroiddata/-/commit/578fee5d169ed569b7d07e30ed853d94b576d420 :tada:
Thanks and sorry for the mixup
Thanks, all good!
Just for information: Building with Android Studio automatically fires the "buildNative" task when I click on the button to "assembleDebug".
We're not building Debug, try assembleRelease
too...
Updated recipe to use Java 17 but this happened: https://gitlab.com/fdroid/fdroiddata/-/jobs/5475535486#L3951
/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/8a34540e89d84da94dc4a90f546ca858857deb3f