我刚刚切换到 Ubuntu,并安装了 IntelliJ IDEA 14 社区版.当我导入现有项目时,我发现 IntelliJ 似乎找不到任何 LibGDX 依赖项.我事先安装了 Gradle.我尝试使用 IntelliJ 项目中包含的 Gradle 包装器并说 ./gradlew --refresh-dependencies
,但这似乎并没有起到什么作用.我的外部 TweenEngine 包加载得很好.似乎只有 IntelliJ 遇到问题的 LibGDX 包.我不希望 IntelliJ 将我的项目视为 Gradle 项目,因为它必须同步.在这方面我更喜欢自己做.
I have just switched to Ubuntu and I've installed IntelliJ IDEA 14 Community Edition. When I imported my existing project, I found that IntelliJ can't seem to find any of the LibGDX dependencies. I installed Gradle beforehand. I've tried using the Gradle wrapper included with the IntelliJ project to and saying ./gradlew --refresh-dependencies
, but this doesn't seem to do much of anything. My external TweenEngine packages were loaded just fine. It seems to only be with the LibGDX packages that IntelliJ is having a problem with. I do not wish to have IntelliJ see my project as a Gradle Project, as then it will have to sync. I prefer to do things myself in that regard.
我的猜测是 Gradle 没有安装 LibGDX 依赖项,但我不完全确定为什么会发生这种情况../gradlew --refresh-dependencies
不应该安装它们吗?我得到的错误都和这个一样,只是包名不同,行号不同:
My guess is that Gradle isn't installing the LibGDX dependencies, but I'm not entirely sure why that would be happening. Shouldn't ./gradlew --refresh-dependencies
install them? The errors I get are all the same as this one, just with different package names and different line numbers:
Error:(7, 24) java: package com.badlogic.gdx does not exist
行号与我的 LibGDX 类导入相关,所以这让我相信 Gradle 没有安装依赖项.
The line numbers correlate to my LibGDX class imports, so this is what leads me to believe that Gradle is not installing the dependencies.
当我导入项目时,我选择了 build.gradle 文件.我有指向有效 Android SDK 的 local.properties 文件.
When I imported the project, I selected the build.gradle file. I have the local.properties file pointing to a valid Android SDK.
如果您想具体了解该项目并希望获得比我提供的更多详细信息,请随时查看源代码:http://bitbucket.org/Sonic2kk/mr.-ballguy/
If you want a specific look at the project and would like more detail than I have provided, feel free to check out the source code: http://bitbucket.org/Sonic2kk/mr.-ballguy/
什么可能导致这些错误,我该如何纠正它们?
What could be causing these errors and how can I correct them?
尝试安装android sdk.如果这不起作用,请尝试重新安装 IntelliJ.
Try installing the android sdk. If that doesn't work, try reinstalling IntelliJ.
另外,尝试将您的 IntelliJ 项目链接到 IntelliJ 的 Gradle 插件.
Also, try linking your IntelliJ project to IntelliJ's Gradle plugin.
这篇关于IntelliJ 找不到任何 LibGDX 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!