1

About two weeks ago i started doing some small apps in Android Studio.

Im pretty new to this environment so im having this problem.

Last night i was working on my app, everything was running so i saved and turned off my pc.

Today i opened Android studio and the message:

Unable to load class 'com.google.common.base.Preconditions'.

And i dont know how to solve it , i already tried this things:

  • Do a clean install of Android Studio
  • Clean Project & Build project (Tried it but no solution)
  • Check "Offline mode" (It was already checked off)
  • Invalidate Cache/Restart (Done it but no solution)
  • Erase "gradle" folder from my "Android" folder, but no "Automatic" download happened when i reopened so i had to reinstall the application

Ive already saw a lot of posts from differente forums but im not getting any solution

Thanks to all

Hilalkah
  • 945
  • 15
  • 37
Felipe Otero
  • 77
  • 1
  • 2
  • 8
  • `Offline mode` is ***not*** checked, right? Also, see couple of suggested answers on https://stackoverflow.com/questions/50288134/android-studio-unable-to-load-class-com-google-common-base-preconditions-gra – chickity china chinese chicken Sep 07 '18 at 23:57
  • @davedwards hello, ive alried tried everything in that article and yes, offline mode is deactivated – Felipe Otero Sep 08 '18 at 00:21

1 Answers1

1

Try deleting the .gradle directories both in your home directory and in your project's directory and see if it works. I believe that, since Android Studio will be forced to re-download all the files for the current version of gradle, it might solve your problem.

Talendar
  • 1,841
  • 14
  • 23
  • Hello, what do you mean with "At the top level of your project"? Sorry, english is not my native language – Felipe Otero Sep 08 '18 at 06:03
  • In your project's folder (normally inside the folder `AndroidStudioProjects`), delete all files that have `gradle` in their name. Remember to make a backup before. See if it works and tell us here. – Talendar Sep 08 '18 at 23:49
  • Hello, thanks for the help. After i deleted it, Android Studio downloaded all the data and now is working fine – Felipe Otero Sep 09 '18 at 22:35
  • I'm glad it helped! Please select this as your answer so it can help others as well (click on a grayed out "tick" icon on the left side of the answer). – Talendar Sep 09 '18 at 22:49