我下载了新的libgdx设置,每次我用box2dlights生成一个项目时,它都会失败,而且我无法导入它,因为它总是给我一个关于找不到box2dlights的错误。在以前的gdx安装-ui中,我无法访问第三方库,因此我对libgdx感到沮丧。
* 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
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文档,这是我所需要的,而且我没有更改任何设置,所以默认情况下一切都应该正常工作,不是吗?
发布于 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)
https://stackoverflow.com/questions/23201235
复制相似问题