Gradle freezes when performing tasks: [: android: generateDebugSources

Since upgrading my Mac OS X to El Capitan (and Android Studio 1.5.1 to 2.x with all tools and sdks), I have had problems with my libgdx-robovm game in Android Studio. When I execute Gradle Sync, it always freezes:

Tasks: [: android: generateDebugSources ,: android: generateDebugAndroidTestSources ,: android: mockableAndroidJar ,: android: prepareDebugUnitTestDependencies ,: android-full: generateDebugSources ,: android-full: generateDebugAndroidTestSources ,:And Android-complete: prepareDebugUnitTestDependencies]

Always. By hanging, I mean this happens forever.

I saw several topics with the same problem, but I can not find a solution, and I'm really disappointed. I tried:

1) Make sure I have zlib installed (s / usr / include / zlib.h),

2) In the global settings of Gradle, I tried to turn on "Offline work", but the result will be the same

3) Clearing robovm and Gradle cache,

4) Reboot Android Studio,

5) Update Android Studio to the latest stable version,

6) I tried the last gradle, but it only raised new problems, finally, after getting rid of them, I got to the same point (hanging),

7) Removing the .gradle directory,

8) Removing the contents of the assembly directory,

9) Clean and rebuild,

10) Invalidate and Restart - after restarting it does not hang, but any operation (cleaning, rebuilding, synchronization) again hangs Gradle,

11) Tried an older Android studio (1.5.1),

12) Tried different versions of the Gradle plugin: 1.2.3, 1.5.0, 2.0 +

13) Tried various Android build tools (22.0.1 and 23.xx)

14) Compilation directly from the console (with -d for more logs):

A few last lines:

11:17: 41.891 [DEBUG] [Org.gradle.model.internal.registry.DefaultModelRegistry] Transition of the "tasks.tasks" model element to the GraphClosed state.

11:17: 41.891 [INFO] [Org.gradle.execution.TaskNameResolvingBuildConfigurationAction
]

Selected tasks of the main task from the project: 11:17: 41.893 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskGraphExecuter] Dates:

The creation of the DAG was 0.002 seconds 11:17: 41.894 [INFO] [org.gradle.BuildLogger] All evaluated projects.

Configuration> 7/7 projects

(coming forever ...)

edit:

The problem that probably caused this freeze was that I had 2 subprojects for ios (robovm), and when I deleted one of them, it finally worked. This is only a problem for ios, since for submodules of android 2 there was no problem. I also had to upgrade robovm to the latest version.

+7
android android-studio gradle libgdx robovm
source share
4 answers

We had this problem in our store after the last update, but all we had to do was

Assembly> Clean Project

Assembly> Restructuring Project

try to start it, if it does not work, go to

File> Invalid Cache / Reboot and select "Invalid and reload"

then close the project, close it and run it again.

+2
source share
delete .gradle file and after that Build > Clean Project Build > Rebuild Project 

try to start it, if it does not work, go to

 File > Invalid Caches / Restart and select "Invalidate and Restart" 

then close the project, close it and run it again.

+2
source share

Try also some of them:

  • Delete manually all created assemblies.
  • In Settings -> Build Tools -> check for default wrapper gradle.
  • Delete additional versions of gradients, save the latest version in the studio.
  • Invalid and restart.

Hope this solves your problem. :)

0
source share

I overcome this problem as follows:

File: Settings β†’ Instant Launch β†’ Disable Instant Launch

and then

Invalid Cache and Reboot

0
source share

All Articles