Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix Android Studio getting stuck executing Gradle tasks?

Android Studio (Beta) 0.8.6 gets stuck when I try to build/run the project, as well as clean it. It stays responsive, but the Gradle: Executing Tasks message doesn't disappear (longer than 20 minutes is when I give up) and the app never runs.

This is what I attempted:

  • Invalidate caches/restart

  • Force quit and restart

  • Remove it from Applications (on Mac) and re-download it from the official website.

enter image description here

like image 777
Oleksiy Avatar asked Sep 02 '14 17:09

Oleksiy


People also ask

Why does Gradle build take so long?

Check your Internet connection. If internet speed is very slow gradle build will also take long time to build. I check by change my wifi internet connection with another one good speed connection. Now build time is normal.


2 Answers

Fixed it by going to Android Studio -> Preferences -> Gradle -> and ticking Offline work. Still have no idea what was wrong, but at least now it compiles.

Edit: In new Android Studio Versions the path is File -> Other Settings -> Default Settings -> Build-Excecution-Deployment -> Gradle

like image 59
Oleksiy Avatar answered Oct 19 '22 17:10

Oleksiy


The question seems old but in case anyone need it.

I have just faced this problem recently, after a fresh Ubuntu 14.04 installation. After google for a while with no luck i checked the terminal, it turned out that libz.so.1 is missing. So i installed it, worked like charm.

Installing instruction here: libz.so.1: cannot open shared object file

like image 51
tuanna Avatar answered Oct 19 '22 19:10

tuanna