Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

package com.google.api.client.http.apache doesn't exist when importing project from Eclipse ADT to Android Studio

I am in the process of migrating project from Eclipse ADT to Android Studio. Progress went smooth until I run the project.

I got several package doesn't exist errors:

Error:(34, 41) error: package com.google.api.client.http.apache does not exist
Error:(81, 19) error: cannot find symbol variable transport
Error:(81, 36) error: cannot find symbol class ApacheHttpTransport
Error:(170, 27) error: cannot find symbol variable transport
Error:(170, 44) error: cannot find symbol class ApacheHttpTransport

The packages was related to Google's API Client library. I added the dependencies manually by scanning through Maven Repository page:

compile 'com.google.api.client:google-api-client-auth-oauth:1.2.3-alpha'
compile 'com.google.api.client:google-api-client-http:1.2.3-alpha'
compile 'com.google.api.client:google-api-client-apache:1.2.3-alpha'

However, I can't seems to find the right dependency for com.google.api.client.http.apache. Someone care to share the right way to add this dependency?

like image 545
ariefbayu Avatar asked Mar 24 '26 18:03

ariefbayu


1 Answers

With current Android Studio and/or Gradle use

implementation 'com.google.api-client:google-api-client:1.28.0'
implementation 'com.google.http-client:google-http-client-gson:1.28.0'

Source: https://github.com/googleapis/google-api-java-client

like image 194
Code-Apprentice Avatar answered Mar 26 '26 08:03

Code-Apprentice