繁体   English   中英

libgdx utils HTML

[英]libgdx utils HTML

我尝试GWT编译我的libgdx项目,该项目使用来自http://dermetfan.net/的 libgdx utils

我有一个非常类似的问题, 无法使用libgdx-utils运行html libgdx

但没有什么能帮助我......

我已经一步一步地完成了所有工作,编辑了我的build.gradlehttps://bitbucket.org/dermetfan/libgdx-utils/wiki/Dependency%20Instructions

现在它看起来像:

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:1.2.3'
    }
}

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

    version = '1.0'
    ext {
        appName = 'TEST'
        gdxVersion = '1.6.2'
        roboVMVersion = '1.3.0'
        box2DLightsVersion = '1.3'
        ashleyVersion = '1.4.0'
        aiVersion = '1.5.0'
        gdxUtilsVersion = '0.11.0'
        gdxUtilssVersion = '0.13.1'
    }

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

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


    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"

        compile "net.dermetfan.libgdx-utils:libgdx-utils:$gdxUtilssVersion"
        compile "net.dermetfan.libgdx-utils:libgdx-utils-box2d:$gdxUtilssVersion"
    }
}

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"
        compile "com.badlogicgames.gdx:gdx-box2d-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"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
    }
}

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"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources"
        compile "com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources"
        compile "net.dermetfan.libgdx-utils:libgdx-utils-box2d-gwt:$gdxUtilsVersion:sources"
    }
}



tasks.eclipse.doLast {
    delete ".project"
}

和错误:

Compiling module com.adacho.test.GdxDefinition
   Validating units:
      [ERROR] Errors in 'file:/C:/ADACHO/LibGDX%20-%20Projekty/PROJEKTY/TEST/core/src/com/adacho/test/obiekty/Ground.java'
         [ERROR] Line 21: No source code is available for type net.dermetfan.gdx.graphics.g2d.Box2DSprite; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/ADACHO/LibGDX%20-%20Projekty/PROJEKTY/TEST/core/src/com/adacho/test/obiekty/MovingPlatform.java'
         [ERROR] Line 26: No source code is available for type net.dermetfan.gdx.graphics.g2d.Box2DSprite; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/ADACHO/LibGDX%20-%20Projekty/PROJEKTY/TEST/core/src/com/adacho/test/obiekty/Postac.java'
         [ERROR] Line 47: No source code is available for type net.dermetfan.gdx.graphics.g2d.AnimatedBox2DSprite; did you forget to inherit a required module?
         [ERROR] Line 88: No source code is available for type net.dermetfan.gdx.graphics.g2d.AnimatedSprite; did you forget to inherit a required module?
   [ERROR] Aborting compile due to errors in some input files

让我感到惊讶的是,当我清除我的构建时,没有任何变化? 这是问题吗? 请帮帮我,我花了几天时间解决这个问题......

GWT编译器说:

No source code is available for type net.dermetfan.gdx.graphics.g2d.AnimatedSprite
No source code is available for type net.dermetfan.gdx.graphics.g2d.Box2DSprite

AnimatedSprite驻留在libgdx-utils
Box2DSprite驻留在libgdx-utils-box2d

显然GWT缺少这些库的源代码,因此您需要将它们添加到HTML项目的依赖项中。

您的HTML项目的依赖项现在应如下所示:

compile "net.dermetfan.libgdx-utils:libgdx-utils:$gdxUtilsVersion:sources"
compile "net.dermetfan.libgdx-utils:libgdx-utils-box2d:$gdxUtilsVersion:sources" // Box2D module (sources)
compile "net.dermetfan.libgdx-utils:libgdx-utils-box2d-gwt:$gdxUtilsVersion:sources" // Box2D module GWT specific classes (sources)

libgdx-utils-box2d-gwt只包含GWT特定的类,不包含libgdx-utils-box2d所有内容。 事实上,我希望将来一段时间内完全删除libgdx-utils-box2d-gwt

看来wiki上的示例构建脚本有同样的问题,对不起。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM