问题
When I set google api at Gradle,
appear an error dialog
Error:(30, 13) Failed to resolve: com.google.api-client:google-api-client-android:1.21.0
my classes want to import
import com.google.api.client.util.Lists;
and
build.Gradle(Module:app) -> dependencies
compile 'com.google.api-client:google-api-client-android:1.21.0'
What can I do.
回答1:
First of all you have to launch the sdk manager and download and install the following files located under "extras": Android support repository, Google play services, Google repository.
Then Clicking the button 'Sync Project With Gradle Files' should do the trick:
Tools -> Android -> Sync Project with Gradle Files
If that fails, try running 'Rebuild project':
Build -> Rebuild Project
回答2:
Update Google Play Services from your android sdk and try again.
来源:https://stackoverflow.com/questions/34805574/android-studio-import-google-api-failed