The accepted answer did not work for me, but this did:
- Download the GSON JAR file and copy it to your /libs/ folder inside your application project.
-
Open the build.gradle file at the root level of your project and edit your dependencies to include the new .jar file:
dependencies { compile fileTree(dir: 'libs', include: '*.jar') } - Build -> Rebuild Project
Optionally, you can specify one or more specific JAR files with files rather than fileTree, such as:
compile files('libs/google-gson-1.7.1/gson-1.7.1.jar')