Cannot resolve import

Am trying to use the GsonFactory class in my app:

StudentApi.Builder builder = new StudentApi.Builder(AndroidHttp.newCompatibleTransport(), new GsonFactory(), null);

but it says cannot resolve symbol 'GsonFactory'

I have the import in my class


but gson couldn't be resolved so I tried Alt-Enter - Find jar on web but the library couldn't be found.

I have this in my build.gradle dependencies:

dependencies {
   compile ''
   compile ''

I can confirm that this class does exist.

You need to use this library:

compile ''

google-http-java-client/ at master · googleapis , NetHttpTransport; import;. but I am getting the next error message: " cannot be resolved to a type". GSON Extensions to The Google APIs Client Library For Java. GSON Extensions to The Google APIs Client Library For Java License: Apache 2.0: Tags: google json client api:

GsonFactory is from the older version.

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

Import it like this import;

External Libraries Compilation · Issue #369 · google/j2objc · GitHub, Download the latest zip file, which you can find on the downloads page, and extract If you are using the Google API Client Library for Java with Android, it is important to google-http-client-android-1.32.1.jar; gson-2.8.6.jar  The following are top voted examples for showing how to use examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.

In your you need to add:

compile ('') {
    exclude module: 'httpclient'


compile('') {
    exclude(group: '', module: 'android')

After doing so, you will be able to use:

Setup Instructions | API Client Library for Java, public class GsonFactory extends JsonFactory. Low-level JSON library implementation based on GSON. mais il dit cannot resolve symbol 'GsonFactory' J'ai l'importer dans ma classe. import com. google. api. client. json. gson. GsonFactory; mais gson ne pouvait pas être résolu j'ai donc essayé Alt-Enter - Find jar on web mais la bibliothèque n'a pas pu être trouvé. J'ai cela dans mon build.gradle dépendances:

this object is only in older versions of the google-http-client try whit the 1.9.0-beta version

compile ''

files.get and .getRequestFactory cannot be resolved, Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

GsonFactory (google-http-java-client 1.35.0), Version of google-api-java-client (e.g. 1.5.0-beta)? 1.6.0-Beta Java environment (e.g. Java 6, Android 2.3, App Engine)? Java 6, Android 2.2 Describe the problem. In the YouTube Sample code, when creating the final jsonFactory = new JacksonFactory(), I get a runtime exception on the Android emulator saying class not found, JacksonFactory.

не удается разрешить импорт , Contribute to google/google-api-java-client-samples development by creating an account on GitHub.

files.get and .getRequestFactory cannot be resolved, Hi, The article you referred is old and the steps have changed. Better approach would be to use the latest version of Selenium and GeckoDriver if you want to run your scripts on Firefox.

  • You can also use JacksonFactory if possible.…
  • You can also use JacksonFactory() in lieu of GsonFactory for those API builders if there is some trouble with the dependency.
  • One more comment: For some reason if using the maven dependency doesn't download the Gson library -- you can just include the library manually.…