2014-10-02 56 views
1

我在将IntelliJ IDE中的gxd-tools.jar添加为Core Library之后,在IntelliJ中构建Core/Desktop/Android项目时遇到了问题。LibGdx工具错误

请注意我的进口:

package com.enplug.exampleapp; 

import com.badlogic.gdx.Gdx; 
import com.badlogic.gdx.files.FileHandle; 
import com.badlogic.gdx.graphics.GL20; 
import com.badlogic.gdx.graphics.Texture; 
import com.badlogic.gdx.graphics.g2d.BitmapFont; 
import com.badlogic.gdx.graphics.g2d.SpriteBatch; 
import com.badlogic.gdx.utils.GdxRuntimeException; 
import com.enplug.common.logging.ILog; 
import com.enplug.sdk.hosting.AppState; 
import com.enplug.sdk.hosting.HostedGame; 
import com.enplug.sdk.interfaces.FontType; 
import com.enplug.sdk.interfaces.IServiceProvider; 
import com.enplug.sdk.model.social.SocialFeedDefinition; 
import com.badlogic.gdx.graphics.g2d.freetype.*; 

import com.badlogic.gdx.tools.imagepacker.TexturePacker2; 

和TexturePacker代码:

TexturePacker2.process("C:\\pokusatlas", "C:\\pokusatlas", "spritesheet"); 

我的错误的屏幕截图:

gdx-tools compilation errir

我应该怎么做,以避免这个错误?

回答

0

查看关于adding libgdx tools to the gradle dependencies的指南。让我引用重要部分:

Tools Gradle

Core Dependency:

Dont put me in core!

==>你不应该添加gdx工具到核心项目!把它放在桌面上,而不是项目:

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

问题与添加libgdx的工具,以核心项目就是libgdx工具不与Android/IOS项目兼容。但是android/ios依赖于核心项目,所以你不能将依赖plattform的库添加到你的核心项目中。

但即使有可能包含在核心项目中也不是一个好主意。我的意思是你不会在你发布的应用程序中运行TexturePacker。在开发过程中运行TexturePacker,并将其输出包含在android资源文件夹中。