LibGDX project can't find assets folder

最后都变了- 提交于 2021-02-07 06:48:20

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/26195511/libgdx-project-cant-find-assets-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!