Gradle插件';com.apollographql.apollo';不在Android Studio中同步

Gradle插件';com.apollographql.apollo';不在Android Studio中同步,android,android-studio,kotlin,graphql,Android,Android Studio,Kotlin,Graphql,我正在尝试在我的Kotlin Android项目中安装apollo graphql插件 根据中的说明,我正在尝试使用遗留语法的安装过程 我的build.gradle(应用程序)文件: 我的build.gradle(项目)文件: 当我尝试同步gradle文件时,会出现以下错误: Plugin with id 'com.apollographql.apollo' not found. 我一直在试图找出哪里出了问题,但无法做到这一点。在此方面的任何帮助都将不胜感激。所以我只是想知道为什么gradle

我正在尝试在我的Kotlin Android项目中安装apollo graphql插件

根据中的说明,我正在尝试使用遗留语法的安装过程

我的build.gradle(应用程序)文件:

我的build.gradle(项目)文件:

当我尝试同步gradle文件时,会出现以下错误:

Plugin with id 'com.apollographql.apollo' not found.

我一直在试图找出哪里出了问题,但无法做到这一点。在此方面的任何帮助都将不胜感激。

所以我只是想知道为什么gradle没有同步。首先,build.gradle(app)文件是完全正确的。没有变化。其次,为了使其正常工作,您必须进行的主要更改或添加是在build.gradle(项目)文件中添加以下行:

就在依赖项{}块中注释的上方

因此,build.gradle(项目)文件现在将如下所示:

//顶级生成文件,您可以在其中添加所有子项目/模块通用的配置选项

buildscript {
    ext.kotlin_version = '1.4.10'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "com.apollographql.apollo:apollo-gradle-plugin:2.3.1"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Plugin with id 'com.apollographql.apollo' not found.
classpath "com.apollographql.apollo:apollo-gradle-plugin:2.3.1"
buildscript {
    ext.kotlin_version = '1.4.10'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "com.apollographql.apollo:apollo-gradle-plugin:2.3.1"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}