未找到 ID 为“gwt”的插件

Posted

技术标签:

【中文标题】未找到 ID 为“gwt”的插件【英文标题】:Plugin with id 'gwt' not found 【发布时间】:2017-06-03 10:45:24 【问题描述】:

构建 libgdx 项目

每次构建项目时,我第一次遇到错误re-download dependencies and sync project。然后我从这个POST得到了解决方案 我确实按照帖子的指示更改了以下内容

file -> project structure -> project

我。 gradle 版本从 3.3 到 2.14.1

二。将 android studio 插件更新到 2.2.3(未设置

我确实从最近工作的 android 项目中获取了值

我的build.gradle

buildscript 
    repositories 
        mavenCentral()
        maven 
            url "https://oss.sonatype.org/content/repositories/snapshots/"
        
        jcenter()
    
    dependencies 
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'org.robovm:robovm-gradle-plugin:1.14.0'
    


allprojects 
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'
    ext 
        appName = 'FirstDemo'
        gdxVersion = '1.6.4'
        roboVMVersion = '1.14.0'
        box2DLightsVersion = '1.4'
        ashleyVersion = '1.4.0'
        aiVersion = '1.5.0'
    

    repositories 
        mavenCentral()
        maven  url "https://oss.sonatype.org/content/repositories/snapshots/" 
        maven  url "https://oss.sonatype.org/content/repositories/releases/" 
    


project(":desktop") 
    apply plugin: "java"


    dependencies 
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
    


project(":android") 
    apply plugin: "android"

    configurations  natives 

    dependencies 
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
    


project(":core") 
    apply plugin: "java"


    dependencies 
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
    


project(":ios") 
    apply plugin: "java"
    apply plugin: "robovm"


    dependencies 
        compile project(":core")
        compile "org.robovm:robovm-rt:$roboVMVersion"
        compile "org.robovm:robovm-cocoatouch:$roboVMVersion"
        compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
    


project(":html") 
    apply plugin: "gwt"
    apply plugin: "war"


    dependencies 
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
    


tasks.eclipse.doLast 
    delete ".project"

现在我收到错误“未找到 ID 为 'gwt' 的插件”。有人可以帮忙吗!

【问题讨论】:

【参考方案1】:

将此依赖项添加到根 build.gradle 文件的 buildscript 标记中

classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'

添加后您的构建脚本如下所示

buildscript 
    repositories 
        mavenCentral()
        maven 
            url "https://oss.sonatype.org/content/repositories/snapshots/"
        
        jcenter()
    
    dependencies 
        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'org.robovm:robovm-gradle-plugin:1.14.0'
    

【讨论】:

以上是关于未找到 ID 为“gwt”的插件的主要内容,如果未能解决你的问题,请参考以下文章

未找到 GWT RPC 服务

未找到 ID 为“org.sonarqube”的插件

未找到 ID 为“com.android.feature”的插件。安卓

错误:(2, 0) 未找到 ID 为“jetty”的插件

未找到 ID 为“com.google.firebase.appdistribution”的插件

Gradle 无法安装 - Gradlew InstallDebug 失败插件,ID 为“...”未找到