Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to debug Gradle sync failed, that has no other information alongside?

I'm trying to build Telegram's source code on my machine, and it doesn't get built.

At first I didn't have NDK installed, so I installed that. Now I'm getting this very stupid error saying Gradle sync failed and giving me no more information whatsoever.

Here's what I tried so far, based on seeing answers in other questions:

  • Invalidate cache / restart
  • Deleting .gradle folder
  • Restarting Android Studio
  • Restarting computer

None of these steps solved the problem. The truly annoying thing is that it doesn't give me more information. That's very very annoying and stupid.

enter image description here

What should I do?

Update: Gradle console is completely empty. Not even one line is written there.

like image 207
mohammad rostami siahgeli Avatar asked Oct 18 '25 13:10

mohammad rostami siahgeli


2 Answers

Encountered exact situation where 'gradle sync failed' was the only message I was getting. No 'Messages' or error information.

So I did the following, opened the terminal from 'Android Studio' itself.

Open the terminal from Android Studio

gradlew tasks

This should list all the tasks that gradle can execution on project. If your project has not built properly you should get 'check'.

gradlew check --stacktrace

The above command would give complete stacktrace about the issue and hopefully then you can troubleshoot. I could do it for my project

Edit : In gradle.properties(root folder), you can add following :

org.gradle.console=verbose

org.gradle.logging.level=debug

Details : https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties

like image 81
Chota Bheem Avatar answered Oct 21 '25 03:10

Chota Bheem


works for me using following code on macOS.

./gradlew tasks

and

./gradlew check --stacktrace

tks

like image 42
Ygor Yuri Avatar answered Oct 21 '25 04:10

Ygor Yuri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!