"Connection refused" Displayed During Gradle Compilation
Symptom
The message "Connection refused" is displayed during Gradle compilation.
Key Process and Cause Analysis
An attempt is made to establish a connection, but the connection is rejected by the remote server or local service.
Conclusion and Solution
- Create build.sh.
1vim build.sh - Press i to enter the insert mode and add the following content to the script:
./gradlew while [ $? -ne 0 ] do sleep 3 ./gradlew done
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Run the script.
1sh build.sh
Parent topic: Troubleshooting