简体   繁体   中英

LibGDX project can't find assets folder

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?

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: 在此输入图像描述

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

在此输入图像描述

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

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM