简体   繁体   中英

libgdx: The declared package does not match the expected package “”

I'm working with LibGdx and Eclipse, I used the latest version and the setup tool that creates the project for Android, desktop and another one named "core", I imported in Eclipse, but I keep getting this error in both desktop and android projects:

The declared package "com.mygdx" does not match the expected package ""

在此处输入图片说明

Could you help me out please? Thanks in advanced!

Right click on the src folder and select Build Path -> Use as Source Folder. Then restart Eclipse.

EDIT: right click project -> Properties -> java Build Path -> Source -> Add Folder -> select src/

Basically eclipse is not able to descend your package tree correctly. After this refresh the project try a clean build.

Just in case someone might find it useful, the actual problem was to add numbers in the project's name, that's why the package was splitted after com.mygdx, then the separate folders were created and gave me errors. I deleted this project, created another without numbers and that did the trick.

Thanks a lot for the help, still learning this libgdx + gradle!

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