Пытаюсь подключить API Google Sheets в проект. Делаю по инструкции:
https://developers.google.com/sheets/api/quickstar...
Получаю ошибку на первом шаге:
IdeaProjects\Sheets_v3>gradle init --type basic
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\fedorov.p\IdeaProjects\Sheets_v3\build.gradle' line: 14
* What went wrong:
A problem occurred evaluating root project 'Sheets_v3'.
> Could not find method compile() for arguments [com.google.api-client:google-api-client:1.30.4] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at
https://help.gradle.org
BUILD FAILED in 849ms
Почему не выходит? Grandle обновил, IDE тоже
Код:
apply plugin: 'java'
apply plugin: 'application'
mainClassName = 'SheetsQuickstart'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.api-client:google-api-client:1.30.4'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.30.6'
compile 'com.google.apis:google-api-services-sheets:v4-rev581-1.25.0'
}