无法将gdx-tools添加到libgdx gradle项目 [英] Can't add gdx-tools to libgdx gradle project

查看:227
本文介绍了无法将gdx-tools添加到libgdx gradle项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Gradle。我试图将gdx-tools添加到我的项目中:
$ b $ pre $ project(:desktop){
apply插件:java


依赖关系{
编译项目(:core)
编译com.badlogicgames.gdx:gdx-backend-lwjgl:$ gdxVersion:
compilecom.badlogicgames.gdx:gdx-box2d-platform:$ gdxVersion:natives-desktop
compilecom.badlogicgames.gdx:gdx-platform:$ gdxVersion:natives-desktop
compile
compilecom.badlogicgames.gdx:gdx-tools:$ gdxVersion
}
}

我打开桌面项目文件夹Gradle Dependecies并查看gdx-tools-1.0.1.jar。当我尝试打开它时 - 没有任何显示。所以,当我尝试使用它(我想尝试打包图像到图集) - 我无法导入com.badlogic.gdx.tools ... $ b

/ p>

我做错了什么?

解决方案

我有同样的问题。所以我把com.badlogicgames.gdx:gdx-tools:1.9.2放到我的浏览器中,看看它带到了哪里。 (1.9.2是我的gdx版本)果然,它并没有带我到一个页面,而是到了一个搜索结果。我跟着第一个:

http://mvnrepository.com/artifact/com.badlogicgames.gdx/gdx-tools/1.5.2



说什么有一个新的版本 - 1.9.2(嗯,这是我想要达到的,谢天谢地,有一个链接,我遵循它。)



< a href =http://mvnrepository.com/artifact/com.badlogicgames.gdx/gdx-tools/1.9.2 =nofollow> http://mvnrepository.com/artifact/com.badlogicgames.gdx/ gdx-tools / 1.9.2



现在,在页面的上方中央,您会看到一个带有代码的选项卡框。选择Gradle并复制该代码。

返回您的Gradle文件中添加:

编译(粘贴)

p>

或者,在我的特殊情况下:

  compile'c​​om.badlogicgames。 gdx:gdx-tools:1.9.2'

现在点击同步。这工作,但我担心硬编码的gdxVersion号码,所以我玩了。如果你用$ gdxVersion替换1.9.2,用双引号(')替换单引号('),它应该同步。现在我的Gradle线看起来像这样:

<$ pre $ $ $ $ $ $ b

为什么?这与我首先尝试的版本看起来完全相同,但我不知道,但这些步骤为我带来了成功的同步。


I'm new in Gradle. I'm trying to add gdx-tools to my project:

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-tools:$gdxVersion"
    }
}

I open my Desktop project, folder "Gradle Dependecies" and see "gdx-tools-1.0.1.jar". As I try to open it - nothing shows.

So, when I try to use it ( I want to try pack images to atlas) - I can't import com.badlogic.gdx.tools...

What I do wrong?

解决方案

I had the same problem. So I put "com.badlogicgames.gdx:gdx-tools:1.9.2" into my browser to see where it took me. (1.9.2 being my gdxVersion) Sure enough it did not take me to a page but to a search result. I followed the first one:

http://mvnrepository.com/artifact/com.badlogicgames.gdx/gdx-tools/1.5.2

Which says there is a new version - 1.9.2 (well, duh - that's what I'm trying to reach. Thankfully, there's a link and I follow it.)

http://mvnrepository.com/artifact/com.badlogicgames.gdx/gdx-tools/1.9.2

Now, in the upper center of the page you'll see a tabbed box with code in the middle. Select Gradle and copy that code.

Back in your Gradle file add:

compile (paste)

Or, in my particular case:

compile 'com.badlogicgames.gdx:gdx-tools:1.9.2'

Now hit sync. This worked but I was worried about hard coding the gdxVersion number so I played around. If you replace the 1.9.2 with $gdxVersion and the single quotes (') with double quotes (") it should sync. So now my Gradle line looks like this:

compile "com.badlogicgames.gdx:gdx-tools:$gdxVersion"

Why? This seems identical to the version I tried first. I don't know. But these are the steps that led to a successful sync for me.

这篇关于无法将gdx-tools添加到libgdx gradle项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆