If you are trying to run Google android sample code, try to import the entire repository instead of an individual sample.
Here is instructions.html, included with the Google Calendar API sample code.
- Import calendar-android-sample project
- Select "Import Project..." or File > Import Project...
- Select [someDirectory]/google-api-java-client-samples/build.gradle and click OK.
- Note: it will not work if you try to import [someDirectory]/google-api-java-client-samples/calendar-android-sample/build.gradle
- Select "Use local gradle distribution" with "Gradle home" of [someDirectory]/gradle-2.2.1 and click OK.