16

After Android Studio update to 2.3, I'm getting the following error.

Console output message

Error:Unable to load class 'org.gradle.logging.StyledTextOutput'. Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Tried to fix

  • I've tried to invalidate cache and restart.
  • Use default gradle wrapper

Someone getting the same error?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Anderson K
  • 5,445
  • 5
  • 35
  • 50

3 Answers3

52

Try to check all your dependencies in build.gradle and update them if needed. In my case updating dexcount gradle plugin solved the problem.

Last cookie
  • 660
  • 7
  • 8
  • 11
    Thank you! That was the reason for me I updated from `0.5.4` to `0.6.2` – Roman Nazarevych Mar 06 '17 at 10:34
  • Any idea, why dex-count caused this problem, and why updating the library fixed that? – Alexander Pacha Mar 08 '17 at 20:02
  • 1
    that was also it for me - went from 0.5.0 to 0.6.2.. oh goodness, thank you, I can deploy the right apk without restarting again!! – Saik Caskey Mar 13 '17 at 13:09
  • 1
    Reference this page to get the most recent version for dex-count https://bintray.com/bintray/jcenter/com.getkeepsafe.dexcount%3Adexcount-gradle-plugin – androidtitan May 06 '17 at 18:02
  • Awesome! how can I live without stackoverflow? :D – Hoang Nguyen Huu May 27 '17 at 10:27
  • Here you can find the latest version for `dexcount-gradle-plugin`: https://github.com/KeepSafe/dexcount-gradle-plugin – Benny Oct 23 '17 at 13:38
  • Thank you! I had the same problem with dex-count. – texnedo Nov 27 '17 at 11:19
  • I have deleted all dependencies, and disabled all plugins and am getting the same error. I've tried clearing cache, manually downloading gradle, restarted several times, I cannot get rid of this error. Is there anything else that might cause this? – JStephen Sep 10 '19 at 03:09
2

After update to Android Studio 2.3, the gradle path wasn't update.

Try to check your settings:

Try to check your settings

Lucas Moretto
  • 404
  • 1
  • 6
  • 18
0

None of these worked for me. Upgrading from android studio 3.3 to 3.4 solved the problem.

Saeed Vrz
  • 147
  • 1
  • 3
  • 10