gradlew taking forever when run from terminal
salmatarzi opened this issue · 7 comments
This is a Sample Project for this issue: https://github.com/salmatarzi/SampleProject/
Expected Behaviour
Running commandlinetool clean
from the terminal from the directory of the Android project to run correctly and terminate.
Actual Behaviour
The command takes forever when running the command from the terminal, however when running it from XCode, it runs perfectly fine, and cleans the Android project
Steps to reproduce
Run commandlinetool clean
from the terminal from the directory of the Android project
Hi, does this only happen when you try to run "./gradlew clean" using SwiftShell, or does it happen with other commands too? I've never used gradle, I tried installing it in a Parallels VM to test this but I only get the error message "Could not determine java version from '10.0.2'.".
@kareman This happens whenever I try to use ./gradlew
command in general, it doesn't happen with other commands though.
Ok, can you try these and see if there is any difference?
echo a | commandlinetool clean
commandlinetool clean | more
You say it takes forever when running from the terminal, does this mean it works, but takes a very long time, or does it never finish?
Also, when you run ./gradlew clean
in the terminal, does it ask for input from the keyboard?
can you try these and see if there is any difference?
The first one worked, terminated and cleaned the project, the second one stayed idle for quite some time not terminating.
You say it takes forever when running from the terminal, does this mean it works, but takes a very long time, or does it never finish?
Yes, it never finishes
Also, when you run ./gradlew clean in the terminal, does it ask for input from the keyboard?
No, it doesn't ask for any input
I think the problem is gradlew
does things differently when standard input is a terminal session. I have seen similar problems before. Try using try "".runAndPrint("./gradlew", "clean")
in CleanCommand.swift to change standard input to an empty stream.
@kareman This worked! Thank you so much 🙏🏽
Glad to hear it. Good luck with the project :)