簡體   English   中英

Android Studio -- 無法應用插件 [id 'appengine']

[英]Android Studio -- Failed to apply plugin [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 上嘗試過以前的解決方案,但它們似乎都不起作用。

項目 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
}

后端 build.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 文件,這是其他堆棧溢出解決方案提供的解決方案,但對我不起作用。 如果有人對此有所了解,那就太好了。

當我將我的項目與 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 上嘗試過以前的解決方案,但它們似乎都不起作用。

項目構建.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
}

后端 build.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 中被棄用並刪除,從 5.X 開始嘗試用 'classesDirs' 替換它。 在這里查看信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM