当我在Android上运行Libgdx项目时,代码的更改不会被反映出来 [英] Changes in code aren't reflected when I run Libgdx project on Android
问题描述
我一直在追踪Libgdx教程这里我遇到一个奇怪的问题。由于我的工作环境的限制,我无法在桌面上下载OpenGL驱动程序,所以我无法在桌面上测试我的应用程序。我必须在我的Android设备上测试。它正在运行Android 2.3.4版本的一些变体,这是API 10级。
I've been following the Libgdx tutorial here and I'm running into a strange problem. Due to the constraints of my work environment, I can't download OpenGL drivers on my desktop, so I can't test my application on the desktop. I have to test it on my Android device. It's running some variation of an Android 2.3.4 build, which is API level 10.
问题是,每当我对代码进行更改并运行Android应用程序时,这些变化没有反映出来。它刚开始构建它第一次运行我的代码安装。我卸载了我的Android上的应用程序并重新运行它,遇到同样的问题。我做了一个全新的Libgdx项目,并将我的新代码复制到它,它的工作正常,直到我对新版本进行了更改,然后遇到了同样的问题。所以我知道一个事实,我正在改变的代码正在改变它的外观,它只是没有被反映。有没有我想要的东西?
The problem is, whenever I make changes to my code and run the Android application, the changes aren't reflected. It just starts the build it installed the first time I ran my code. I uninstalled the app on my Android and re-ran it, running into the same problem. I made an entirely fresh Libgdx project and copied my new code over to it, and it worked fine, until I made more changes to the new version, then I ran into the same problem. So I know for a fact that the code I'm changing is making a difference in how it should look, it just isn't being reflected. Is there something I'm missing?
我的步骤,澄清:
- 使用gdx-setup-ui.jar设置一个Libgdx项目
- 使用默认导入设置将新创建的项目导入到Eclipse中
- 代码一段时间,创建我的应用程序的一些版本(例如,在该教程中,我编写代码,直到我设置调试
ShapeRenderer
,并进行测试以确保我的应用程序看起来正确) - 运行Libgdx Android应用程序在我的手机上测试
- 编写更多内容,更改内容,添加内容,甚至更改图像资产)
- 重新运行Libgdx Android应用程序在手机上测试
- 显示的应用程序与之相同当我在第4步中第一次运行时,是/ />
- 显示的应用程序与之相同当我在第4步中第一次运行时,是/ />
- Set up a Libgdx project with gdx-setup-ui.jar
- Import the newly created project to Eclipse using the default import settings
- Code for a while, creating some version of my application (for instance, in that tutorial, I code till I set up the debug
ShapeRenderer
, and test to make sure my app looks right) - Run the Libgdx Android application to test it on my phone
- Code some more, changing things, adding things, whatever (even changing images in my assets)
- Re-run the Libgdx Android application to test it on my phone
- The application that shows up is the same as it was when I ran it the first time in step 4
推荐答案
这是较新版本的ADT中的错误。请为错误报告作星标让Google意识到这个问题。
This is a bug in the newer versions of ADT. Please star the bug report to make Google aware of the troubles this gives.
最简单的方法是在Eclipse(或任何您正在使用的IDE)中的 clean项目
或添加空格/您的Android项目中的换行符并保存。
Easiest way is to clean project
in Eclipse (or whatever IDE you are using) or to add a space/newline in your Android project and save.
这篇关于当我在Android上运行Libgdx项目时,代码的更改不会被反映出来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!