6

I have suddenly run into an issue with my build environment and I can't figure out why. I can run my project just fine using gradlew desktop:run however, when I try to run the project from Eclipse using right-click run as desktop application (on the desktop project of course) it suddenly cannot find my pack.atlas file. There is no doubt the file exsts. I have refreshed my eclipse project multiple times and the project runs fine using gradle commandline. It was working fine yesterday. The only thing I can think of that made it mess up was I ran a Gradle command from within the IDE yesterday but I'm not sure how it could have got messed up like this. It is important for me to figure out this issue as I cannot use the Eclipse debugger with this error. Does anyone have any guess as to why Eclipse isn't seeing the assets folder?

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
Barodapride
  • 3,475
  • 4
  • 25
  • 36
  • Where is your `pack.atlas` file? Is it in the assets folder of the Android project? If so, you need to add the Android project to the classpath of the Desktop project. – Code-Apprentice Oct 04 '14 at 17:53
  • I should be able to do a gradlew eclipse to generate all the Eclipse files. It doesn't seem to work unfortunately. Maybe it is missing from my .classpath since I don't see my assets folder mentioned there. – Barodapride Oct 04 '14 at 17:59
  • From my limited experience with libgdx, you still have to manually set the classpath in the Eclipse IDE. – Code-Apprentice Oct 04 '14 at 18:03
  • I just tried adding it to the classpath of my desktop project but it doesn't work. I think you're on the right track though. I must have to reference the assets somehow in my classpath file. I'll keep trying. – Barodapride Oct 04 '14 at 18:05
  • What steps did you take to add the Android project to the classpath of your desktop project? Please update your question with these details. – Code-Apprentice Oct 04 '14 at 18:07
  • I simply went into the Java Build Path for my -desktop project. In the Projects tab I added the -android project as a required project. -core was already there as a project. Still failed to find the internal file. – Barodapride Oct 04 '14 at 19:20
  • possible duplicate of [New libgdx setup receive file not found](http://stackoverflow.com/questions/22822767/new-libgdx-setup-receive-file-not-found) – Code-Apprentice Oct 05 '14 at 22:10

1 Answers1

7

Probably your assets from the android project is not correctly linked with the desktop project.

Your linked assets folder from inside the desktop project should look like this: enter image description here

If it doesn't(or it doesn't exists) ,delete the folder(in the desktop project),and go to the the project properties->java build path->source->link source

enter image description here

browse->[select the asset folder inside the android project]->finish

enter image description here

SteveL
  • 3,331
  • 4
  • 32
  • 57