12

Just out of nowhere got this issue on every project in Android Studio 5.2

Gradle 'MyApplication4' project refresh failed:
        Cause: com.google.common.collect.Maps
        Gradle settings

Can really find any infomation about it so will make a check here before reinstall

Mathias Asberg
  • 3,562
  • 6
  • 30
  • 46
  • 1
    Could you be hitting this? http://stackoverflow.com/questions/22670395/gradle-error-unable-to-load-class-com-android-builder-testing-api-deviceprovid – Scott Barta Mar 26 '14 at 19:14

2 Answers2

11

If you change classpath 'com.android.tools.build:gradle:0.9.+' in your build.gradle to classpath 'com.android.tools.build:gradle:0.9.1' it should fix it. The new release 0.9.2 breaks something.

melbic
  • 11,988
  • 5
  • 33
  • 37
Geoff Pascoe
  • 126
  • 1
  • 6
  • Confirmed correct fix, someone on Google quarters pressed the wrong button apparently. – MLProgrammer-CiM Mar 26 '14 at 19:25
  • 1
    Per [the bug report](https://code.google.com/p/android/issues/detail?id=67693) the issue isn't 0.9.2 per se, it's that it became available from Maven Central piecemeal corrupting people's gradle caches because they only got some of the files. The fix is to rebuild the cache now that it's fully available: `gradle --rebuild cache`. – blahdiblah Mar 26 '14 at 20:13
3

Deleting $HOME/.gradle/caches directory and then rebuilding works (It may be required to restart Android Studio.).

ismailarilik
  • 2,236
  • 2
  • 26
  • 37