带有libGdx项目的IntelliJ Gradle同步失败

时间:2019-09-02 13:48:16

标签: gradle intellij-idea libgdx

我正在把libGdx项目中的Gradle与Netbeans的Intellij IDE同步。在热敏电阻上,显示Cause: invalid type code: CD

当我与Eclipse同步时,它可以工作。 它也可以与降级的libGdx版本1.6.1(使用Gradle 2.4)一起使用。

产品输出:

   org.gradle.internal.exceptions.LocationAwareException: Failed to notify build listener.
   Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify build listener.
   Caused by: java.lang.AbstractMethodError: 
   org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier;
  • gradle-wrapper.properties

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1- 
    bin.zip
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    
  • build.gradle

    buildscript {
    
    
        repositories {
            mavenLocal()
            mavenCentral()
            maven { url "https://plugins.gradle.org/m2/" }
            maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
            jcenter()
            google()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.4.1'
    
    
        }
    }
    
    allprojects {
    
        version = '1.0'
        ext {
            appName = "test"
            gdxVersion = '1.9.10'
            roboVMVersion = '2.3.7'
    
        }
    
        repositories {
            mavenLocal()
            mavenCentral()
            jcenter()
            google()
            maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
            maven { url "https://oss.sonatype.org/content/repositories/releases/" }
        }
    }
    
    project(":desktop") {
        apply plugin: "java-library"
    
    
        dependencies {
            implementation project(":core")
            api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
            api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
        }
    }
    
    project(":core") {
        apply plugin: "java-library"
    
    
        dependencies {
            api "com.badlogicgames.gdx:gdx:$gdxVersion"   
        }
    }
    
    project(":android") {
        apply plugin: "android"
    
        configurations { natives }
    
        dependencies {
            implementation project(":core")
            api "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-arm64-v8a"
            natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
            natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" 
        }
    }
    

0 个答案:

没有答案