Archie.bpgc
Archie.bpgc

Reputation: 24012

The method newCompatibleTransport() from the type AndroidHttp refers to the missing type

GoogleAccountCredential credential = GoogleAccountCredential
        .usingOAuth2(MainActivity.this,
                Arrays.asList(DriveScopes.DRIVE_FILE));
credential.setSelectedAccountName(driveAccountName);
//Errors on below line
HttpTransport ht = AndroidHttp.newCompatibleTransport();
Drive service = new Drive.Builder(ht, new GsonFactory(), credential).build();

1. HttpTransport cannot be resolved to a type

2. The method newCompatibleTransport() from the type AndroidHttp refers to the missing type HttpTransport

I have added the following jar files in the libs folder:

  1. google-api-client-android-1.18.0-rc.jar
  2. google-api-services-drive-v2-rev1-1.7.2-beta.jar
  3. google-http-client-android-1.18.0-rc.jar
  4. google-http-client-gson-1.18.0-rc.jar

Upvotes: 2

Views: 1226

Answers (2)

Preetam
Preetam

Reputation: 5768

You'll have to use com.google.api-client:google-api-client-android:1.22.0. Google has deprecated http-client for target versions >= 23

Upvotes: 1

Archie.bpgc
Archie.bpgc

Reputation: 24012

Had to use:

google-http-client-1.18.0-rc.jar

Upvotes: 1

Related Questions