Assets are not updating

Anything libgdx related goes here!

Assets are not updating

Postby samxcr » Mon May 13, 2019 9:58 pm

I have changed some image files in my assets folder and they are appearing correctly in the Package Explorer of Eclipse but when I run my game the new versions do not appear and the old versions are still being used. When I add a new file and try to use it in code I get a "Couldn't load file" error, even though it is appearing in the file hierarchy. It seems like my assets are stuck as what they were 6 hours ago all of a sudden. What could cause this?

The only thing I can think of is that I added new dependencies to the build.gradle file, and I think that was around the time new resources stopped loading. Could that be connected?
samxcr
 
Posts: 6
Joined: Mon May 13, 2019 1:02 am

Re: Assets are not updating

Postby vik182 » Mon May 13, 2019 10:14 pm

You have a bit of code, it's a little complicated to know what is happening
vik182
 
Posts: 44
Joined: Wed Jul 04, 2018 9:44 pm

Re: Assets are not updating

Postby shatterblast » Tue May 14, 2019 3:33 am

samxcr wrote:I have changed some image files in my assets folder and they are appearing correctly in the Package Explorer of Eclipse but when I run my game the new versions do not appear and the old versions are still being used.


First, I suggest swapping to IntelliJ in your spare time. Second, there is the classic need for a Clean and then Rebuild EVERY time you want to test something when you change resources, like images, sounds, or just ANYTHING not a Java file. I know Eclipse is free, but IntelliJ Community Edition offers a lot of the similar "bells and whistles" that can make a thing fly. Just because you can see something plainly as daylight through your IDE of choice does not mean that your IDE's compiler is even slightly aware of it. You could fart in front of your computer, and your IDE would still not know it. A good reason for this is so that you do not automatically suck up something accidentally into your project that may harm it. IntelliJ tried to offer a solution to this through offering automatic importing in Gradle, but it is so terrible. It goes by the name "Configure on Demand", and by typing even a single letter, it would try to import the entire universe and its little pet pony into your project over and over. Or at least, it will try importing whatever is in your build.gradle file. Every time. IT IS EVEN IN THE LIBGDX DOCUMENTATION TO DISABLE IT. Either way, IntelliJ shares a similar problem with that Clean & Rebuild issue, but it seems to treat it just a bit better.

I hope that helps.
Last edited by shatterblast on Tue May 14, 2019 3:50 am, edited 2 times in total.
shatterblast
 
Posts: 406
Joined: Sun Jul 06, 2014 1:14 pm

Re: Assets are not updating

Postby QuiIIraven » Tue May 14, 2019 3:48 am

I agree with shatterblast.

I have to use eclipse at work for some old RCP software and what I have learned over the years is that most errors in eclipse get solved via:
1) refresh your project (f5 and selecting all folders/files)
2) clean and rebuild your entire project
3) if 1 and 2 don't help then restart eclipse

these three steps are so tedious but very important when working with eclipse.

therefore, give intellij a try. community edition is for free and at least I never had to do these manual refreshes and rebuilds anymore.
and maybe you end up like me and many others and you will never look back to eclipse ;)
QuiIIraven
 
Posts: 79
Joined: Sat Jun 02, 2018 4:59 pm

Re: Assets are not updating

Postby samxcr » Tue May 14, 2019 6:17 am

shatterblast wrote:
samxcr wrote:I have changed some image files in my assets folder and they are appearing correctly in the Package Explorer of Eclipse but when I run my game the new versions do not appear and the old versions are still being used.


First, I suggest swapping to IntelliJ in your spare time. Second, there is the classic need for a Clean and then Rebuild EVERY time you want to test something when you change resources, like images, sounds, or just ANYTHING not a Java file. I know Eclipse is free, but IntelliJ Community Edition offers a lot of the similar "bells and whistles" that can make a thing fly. Just because you can see something plainly as daylight through your IDE of choice does not mean that your IDE's compiler is even slightly aware of it. You could fart in front of your computer, and your IDE would still not know it. A good reason for this is so that you do not automatically suck up something accidentally into your project that may harm it. IntelliJ tried to offer a solution to this through offering automatic importing in Gradle, but it is so terrible. It goes by the name "Configure on Demand", and by typing even a single letter, it would try to import the entire universe and its little pet pony into your project over and over. Or at least, it will try importing whatever is in your build.gradle file. Every time. IT IS EVEN IN THE LIBGDX DOCUMENTATION TO DISABLE IT. Either way, IntelliJ shares a similar problem with that Clean & Rebuild issue, but it seems to treat it just a bit better.

I hope that helps.


Thank you. I've switched to IntelliJ and already much prefer it (and my assets are now correctly loading). Thanks! :)
samxcr
 
Posts: 6
Joined: Mon May 13, 2019 1:02 am


Return to Libgdx

Who is online

Users browsing this forum: No registered users and 1 guest

cron