Reputation: 24012
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:
- google-api-client-android-1.18.0-rc.jar
- google-api-services-drive-v2-rev1-1.7.2-beta.jar
- google-http-client-android-1.18.0-rc.jar
- google-http-client-gson-1.18.0-rc.jar
Upvotes: 2
Views: 1226
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