0
votes

I am getting below error in Android Studio.

I tried these things but it didn't work for me.

  1. Deleted the .gradle folder and resync the project
  2. Manually downloaded the gradle distribution & in settings changed gradle to use from specified location.

Unable to load class 'com.google.gson.JsonParseException'. 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.

2

2 Answers

0
votes

Make sure your using suitable version of Gson in gradle file implementation 'com.google.code.gson:gson:<specific version>'

0
votes

I highly recommend importing the library from your build.gradle instead of downloading it.

It might be a possibility that your Android Studio's gradle caches are corrupt. Fix for that is to got your .gradle folder in you Computer's home directory and navigate to caches folder and delete every thing inside it.