-
Notifications
You must be signed in to change notification settings - Fork 71
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
Starting a Gradle Daemon, x busy Daemons could not be reused, use --status for details, recursion until RAM floods #92
Comments
|
This is part of the output of
|
@lattice0: I am not aware of any particular interaction between |
I already tried killing everything, cleaning the gradle folder, etc. And the error happens only when I add the task in build.gradle. The build also does not take that long and the interval between one Gradle daemon and another is like 1 minute
…-------- Mensagem Original --------
Ativo 25 de abr. de 2022 12:26, Nick Alexander escreveu:
***@***.***(https://github.com/lattice0): I am not aware of any particular interaction between rust-android-gradle and the Gradle daemon. You might try killing all of the daemons, perhaps with ./gradlew --stop, and then digging in. The fact that you have busy daemons might mean something -- perhaps some long cargo builds, or something is wedged?
—
Reply to this email directly, [view it on GitHub](#92 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ABSTHAPUUB53CVUOSLTEW5LVG22T5ANCNFSM5UFKMMUA).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@ncalexan I've found many issues like mine but all of them say something about deactivating windows hotspot (https://stackoverflow.com/questions/67044599/flutter-starting-gradle-daemon-loop-creating-endless-processes). However, I'm on Ubuntu and inside docker, and the issue only happens when I add
is there something in this plugin that tries to access something on the internet? I tried deactivating my VPN ad blocker and the VPN itself, but the problem persists. I also deactivated the internet on the VM itself and the problem persisted. So, it seems like it happens only with flutter, and windows hotspot if windows, and in my case only when I add the cargoBuild task as a dependency |
Could you try removing the dependency block above, and instead invoking I will say that the plugin doesn't access anything on the internet itself (that I am aware of), but it will of course spark Gradle to fetch dependencies, and it will also spark Cargo to fetch crates, etc. Can you link your project so that I can see what you're doing? Bonus points if you run this Docker flow in CI already and can link to logs! |
Unfortunately I'm not allowed to post the project but yes, definitely it happens just when I add the block above, I checked many times under different circumstances.
Also tried running as root to see if this is a permission issue, and running old versions of this plugin, and running with stack trace and debug and info, but there's no error, it just spawns another daemin every time.
All the issues I found about this on stack overflow talk about disabling windows hotspot, so it looks like some firewall thinf, but this happens after the part where gradle downloads the dependencies, and if I turn off the internet, gradle does not complain about no internet connection.
…-------- Mensagem Original --------
Ativo 27 de abr. de 2022 23:54, Nick Alexander escreveu:
Could you try removing the dependency block above, and instead invoking ./gradlew cargoBuild directly? That would give you some idea if it's a rust-android-gradle issue directly or if it's more likely to be a flutter interaction.
I will say that the plugin doesn't access anything on the internet itself (that I am aware of), but it will of course spark Gradle to fetch dependencies, and it will also spark Cargo to fetch crates, etc.
Can you link your project so that I can see what you're doing? Bonus points if you run this Docker flow in CI already and can link to logs!
—
Reply to this email directly, [view it on GitHub](#92 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ABSTHAOGCRDR3CNOMKZX7RTVHH4UZANCNFSM5UFKMMUA).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@ncalexan here it is a minimum verifiable example that also recursively starts gradle daemons on the CI: https://github.com/lattice0/flutter_bug/runs/6235250770?check_suite_focus=true |
Maybe that repo isn't public? I certainly can't see it (or the link you provided). |
@ncalexan ops, sorry, made public now, and also as a bonus, a branch with the rust-android-gradle stuff commented out from build.gradle building correctly https://github.com/lattice0/flutter_bug/runs/6235383129?check_suite_focus=true |
@ncalexan just tested and same problem. I tested all possible solutions, tried many different things this week :( |
@ncalexan does it possibly change an environment variable when trying to launch cargo? Some guy at gradle said that the criteria must be exactly as before, otherwise it launches a new daemon again |
Well, we set many environment variables for the Cargo invocations, but I think they're all managed by the |
@ncalexan I called gradle with |
I had a chance to look into this. (It was really only possible for me to do so since you had arranged the Docker environment, etc -- thank you.) Based on some hints in the Gradle daemon log files, which I found using
I haven't verified that the failure occurs when we remove Now, since everything is per-project, there's no need to do this in your root diff --git a/flutter_bug/android/app/build.gradle b/flutter_bug/android/app/build.gradle
index a38331d..dd9b2a0 100644
--- a/flutter_bug/android/app/build.gradle
+++ b/flutter_bug/android/app/build.gradle
@@ -79,3 +79,9 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
+
+tasks.whenTaskAdded { task ->
+ if ((task.name == 'javaPreCompileDebug' || task.name == 'javaPreCompileRelease')) {
+ task.dependsOn 'cargoBuild'
+ }
+}
diff --git a/flutter_bug/android/build.gradle b/flutter_bug/android/build.gradle
index a69ddf5..cf2df46 100644
--- a/flutter_bug/android/build.gradle
+++ b/flutter_bug/android/build.gradle
@@ -30,12 +30,6 @@ subprojects {
project.evaluationDependsOn(':app')
}
-tasks.whenTaskAdded { task ->
- if ((task.name == 'javaPreCompileDebug' || task.name == 'javaPreCompileRelease')) {
- task.dependsOn 'cargoBuild'
- }
-}
-
task clean(type: Delete) {
delete rootProject.buildDir
}
diff --git a/libsomething/src/main.rs b/libsomething/src/main.rs
deleted file mode 100644
index e7a11a9..0000000
--- a/libsomething/src/main.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
- println!("Hello, world!");
-} With this, # flutter build apk
fatal: unsafe repository ('/opt/flutter/development/flutter' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory /opt/flutter/development/flutter
Changing current working directory to: /home/dev/project/flutter_bug
💪 Building with sound null safety 💪
Fresh libsomething v0.1.0 (/home/dev/project/libsomething)
warning: function is never used: `main`
--> src/lib.rs:1:4
|
1 | fn main() {
| ^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: `libsomething` (lib) generated 1 warning
Finished release [optimized] target(s) in 0.00s
Running Gradle task 'assembleRelease'... 3.5s
✓ Built build/app/outputs/flutter-apk/app-release.apk (15.9MB). and I see the Rust library
Good luck! |
thank you, it works. Gonna report this to flutter. Thank you very much!!!! |
You are welcome. What a strange bug! If it turns out this only repros with |
When I added
to my flutter project's build.gradle and when I do
flutter build apk
I get things likeand then it keeps starting a new one until my RAM floods and the computer crashes. If I comment that code, it builds, but of course without gradle.
Is there a way to debug more to see what is hapening? Looking at the system monitor, it's starting lots of java gradle daemons
The text was updated successfully, but these errors were encountered: