IntelliJ can#39;t find any LibGDX packages?(IntelliJ 找不到任何 LibGDX 包?)
问题描述
我刚刚切换到 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 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IntelliJ 找不到任何 LibGDX 包?
基础教程推荐
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01