Cannot resolve import com.google.api.client.json.gson.GsonFactory

You need to use this library:

compile 'com.google.http-client:google-http-client-gson:1.19.0'

In your gradle.build you need to add:

compile ('com.google.http-client:google-http-client-gson:1.19.0') {
    exclude module: 'httpclient'
}

after

compile('com.google.http-client:google-http-client-android:1.19.0') {
    exclude(group: 'com.google.android', module: 'android')
}

After doing so, you will be able to use:

com.google.api.client.json.gson.GsonFactory()

GsonFactory is from the older version.

Now, you should use JacksonFactory.getDefaultInstance() instead.

Import it like this import com.google.api.client.json.jackson2.JacksonFactory;