Android Studio -- 无法应用插件 [id 'appengine']



当我将项目与 Gradle 文件同步时,出现以下错误:

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'appengine']

Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'classesDir' for functional test classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.

我的 gradle 使用的是最新版本,我已经在 Stack Overflow 上尝试了以前的解决方案,但似乎都不起作用。

Project Build.Gradle:


buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}

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

后端构建.gradle:

// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.59'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.59'
compile 'com.google.appengine:appengine-endpoints:1.9.18'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.18'
compile 'javax.servlet:servlet-api:2.5'
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}

似乎主要问题是App Engine插件,但我不确定如何解决这个问题。我相信正在使用最新的gradle文件,这是其他堆栈溢出解决方案提供的解决方案,但对我不起作用。如果有人对此有见解,那就太好了。

'classesDir' 在 gradle 5.X 以后被弃用并删除,请尝试将其替换为 'classDirs'。在此处查看此信息。

最新更新