首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >新的libgdx安装程序构建持续失败。

新的libgdx安装程序构建持续失败。
EN

Stack Overflow用户
提问于 2014-04-21 16:17:51
回答 1查看 3K关注 0票数 1

我下载了新的libgdx设置,每次我用box2dlights生成一个项目时,它都会失败,而且我无法导入它,因为它总是给我一个关于找不到box2dlights的错误。在以前的gdx安装-ui中,我无法访问第三方库,因此我对libgdx感到沮丧。

代码语言:javascript
复制
* What went wrong:
A problem occurred configuring project ':android'.
> Could not resolve all dependencies for configuration ':android:_debugCompile'.
   > Could not find com.badlogicgames.box2dlights:box2dlights:1.2.
     Required by:
         test:android:1.0
         test:android:1.0 > test:core:1.0

当我生成一个没有依赖项检查的项目时,我可以将它导入eclipse,但是我希望能够选择box2dlights,因为我要使用它。我可以在我的build.gradle中看到build.gradle,所以从我收集的内容来看,它应该自动下载。这是我的build.gradle

代码语言:javascript
复制
buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9+'
    }
}

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

    version = '1.0'
    ext {
        appName = 'my-gdx-game'
        gdxVersion = '1.0.0'
        roboVMVersion = '0.0.11'
    }

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

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"
        compile "com.badlogicgames.gdx:gdx-freetype-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-x86"
        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.box2dlights:box2dlights:1.1"
        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"

        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
    }
}

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


    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
        compile "com.badlogicgames.box2dlights:box2dlights:1.2"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
    }
}

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

我可以看到compile "com.badlogicgames.box2dlights:box2dlights:1.1",根据github文档,这是我所需要的,而且我没有更改任何设置,所以默认情况下一切都应该正常工作,不是吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-21 17:41:03

我相信1.2是个错误..。我还不知道box2D灯到目前为止有一个版本1.2,除非它即将到来,而且他们先发制人地让它提前被调用,而不是v1.1。

对于eclipse构建,在将所有的引用都更改为1.2到1.1之后,我能够编译它,而我的gradle构建得很好。

尽管我在使用为gradle构建提供的gdx时遇到了这些错误,但安装仍然有效。

(在您的gradle文件的最底层,我注意到在:core区域,仍然有一个对boxlight 1.2的引用,您应该将其更改为1.1)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23201235

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档