Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changes in code aren't reflected when I run Libgdx project on Android

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.

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?

My steps, to clarify:

  1. Set up a Libgdx project with gdx-setup-ui.jar
  2. Import the newly created project to Eclipse using the default import settings
  3. 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)
  4. Run the Libgdx Android application to test it on my phone
  5. Code some more, changing things, adding things, whatever (even changing images in my assets)
  6. 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
like image 631
Tom Avatar asked Dec 27 '22 18:12

Tom


1 Answers

This is a bug in the newer versions of ADT. Please star the bug report to make Google aware of the troubles this gives.

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.

like image 107
Matsemann Avatar answered Apr 06 '23 06:04

Matsemann