Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F-Droid can't build / missing native issue #1026

Closed
licaon-kter opened this issue Nov 7, 2023 · 26 comments
Closed

F-Droid can't build / missing native issue #1026

licaon-kter opened this issue Nov 7, 2023 · 26 comments
Assignees
Labels
Milestone

Comments

@licaon-kter
Copy link
Contributor

licaon-kter commented Nov 7, 2023

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

@Catfriend1
Copy link
Owner

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

@licaon-kter
Copy link
Contributor Author

@Catfriend1
Copy link
Owner

Do I have to set this in my files or fdroiddata?

@licaon-kter
Copy link
Contributor Author

licaon-kter commented Nov 8, 2023

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?

@Catfriend1
Copy link
Owner

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.

@Catfriend1
Copy link
Owner

we added 4 lines in the recipe.

Okay, I checked that and it seems fine. Thanks.

https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/com.github.catfriend1.syncthingandroid.yml#L1976

@Catfriend1
Copy link
Owner

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 (...)

@licaon-kter
Copy link
Contributor Author

Maybe try to clean up your local gradle/whatever cache and retry to build?

@Catfriend1 Catfriend1 self-assigned this Nov 9, 2023
@Catfriend1
Copy link
Owner

Catfriend1 commented Nov 9, 2023

@licaon-kter Why is it calling gradlew with both "buildNative assembleRelease" according to the log ( ref https://gitlab.com/fdroid/fdroiddata/-/jobs/5475535486#L619 ) ?

image

buildNative is configured as a single and first step in fdroiddata yml...

image
https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/com.github.catfriend1.syncthingandroid.yml#L1987

@Catfriend1 Catfriend1 added this to the v1.26.0 milestone Nov 9, 2023
@Catfriend1
Copy link
Owner

@Catfriend1
Copy link
Owner

The command gradlew :syncthing:buildNative assembleDebug now succeeds on my Windows machine.

@licaon-kter
Copy link
Contributor Author

@Catfriend1
Copy link
Owner

Thank you too :-)

@Catfriend1 Catfriend1 reopened this Nov 13, 2023
@Catfriend1
Copy link
Owner

Catfriend1 commented Nov 13, 2023

@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?

@Catfriend1 Catfriend1 changed the title F-Droid can't build F-Droid can't build / missing native issue Nov 13, 2023
@licaon-kter
Copy link
Contributor Author

licaon-kter commented Nov 13, 2023

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. :(

@licaon-kter
Copy link
Contributor Author

licaon-kter commented Nov 13, 2023

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.

@Catfriend1
Copy link
Owner

@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. 🤷‍♂️

@licaon-kter
Copy link
Contributor Author

re-added via https://gitlab.com/fdroid/fdroiddata/-/commit/e30a9c339e5d47f9aca6a8e8f4ef6cc16678c8bc

But please add a fail mode for this during build

@licaon-kter
Copy link
Contributor Author

hmm we're back at square 1: https://gitlab.com/fdroid/fdroiddata/-/jobs/5525083301#L3743

I'll try something else locally, brb

@licaon-kter licaon-kter reopened this Nov 13, 2023
@Catfriend1
Copy link
Owner

Hmm, I could reproduce the problem on windows before I fixed it. Interesting, that it now returned with the preassemble in place. 🤷‍♂️

@licaon-kter
Copy link
Contributor Author

It's running now with this change that I've done to your upstream: https://gitlab.com/fdroid/fdroiddata/-/commit/4cea94a0b8251d914ba0152a1812729d5064b057#bdbd642de47f8b99c9954756fdff27dc60ec9b7f_2052_2057

@Catfriend1
Copy link
Owner

Can we try this for the fork, please? Do I also need to adjust something on my github repo?

@licaon-kter
Copy link
Contributor Author

Was waiting for the build locally, the APK has the libs/.so hence: https://gitlab.com/fdroid/fdroiddata/-/commit/578fee5d169ed569b7d07e30ed853d94b576d420 🎉

Thanks and sorry for the mixup

@Catfriend1
Copy link
Owner

Thanks, all good!

@Catfriend1
Copy link
Owner

Just for information: Building with Android Studio automatically fires the "buildNative" task when I click on the button to "assembleDebug".

image

@licaon-kter
Copy link
Contributor Author

We're not building Debug, try assembleRelease too...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants