简体   繁体   English

无法修复“将库 'Gradle: com.badlogicgames.gdx:gdx-tools:1.10.0' 添加到类路径”(IntelliJ)

[英]Cannot fix "Add library 'Gradle: com.badlogicgames.gdx:gdx-tools:1.10.0' to classpath" (IntelliJ)

so I need to import a specific class (TexturePacker):所以我需要导入一个特定的类(TexturePacker):

import com.badlogic.gdx.tools.texturepacker.TexturePacker;

however, I receive the error above.但是,我收到上述错误。

Normally, I added this to my build.gradle under dependencies :通常,我将它添加到我的 build.gradle 下的依赖项

classpath 'com.badlogicgames.gdx:gdx-tools:1.10.0'

The problem still remains.问题仍然存在。

Thanks in advance for all answers.预先感谢所有答案。

Try this in project(":core") dependenciesproject(":core")依赖项中试试这个

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

This is assuming you define your gdxVersion, if not you can replace with a specific version.这是假设您定义了 gdxVersion,否则您可以替换为特定版本。 Maybe its easier to run this tool again https://github.com/tommyettinger/gdx-liftoff and copy over the generated files if you have other errors.如果您有其他错误,再次运行此工具可能更容易https://github.com/tommyettinger/gdx-liftoff并复制生成的文件。

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

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