Gradle Build gets stuck at Executing tasks: [:app:

2020-05-21 06:43发布

问题:

I am running Android Studio 1.3.2 on Ubuntu 14.04, with build-tools version 23.0.0.

Whenever I load any project, after the indexing is complete, Gradle shows Gradle Build Running and no matter how long I leave it, it shows no progress or errors.

I have tried these solutions:

  • How to fix Android Studio getting stuck executing Gradle tasks?
  • Gradle gets stuck at either 'build' or 'assembleDebug' when using the 64bit or 32bit version of Android Studio
  • Gradle Build stuck at generate debug sources

But they do not work for me.

Any more solutions? Help will be greatly appreciated

回答1:

I managed to solve the problem after a lot of trial and error.

  • Firstly I changed the build-tools version to 22.0.1. I know this is an outdated version, but it worked for me.
  • After that, Gradle build finished with an aapt error, for which I installed the following.

sudo apt-get install lib32stdc++6 sudo apt-get install lib32z1

These solved the problem for me.



回答2:

sudo apt-get install lib32z1

This dependency was missing in my Ubuntu.. Got it fixed after installing it



回答3:

I had similar problem. Changing buildToolsVersion in build gradle file worked for me.