So, I fixed my problem: I just added the libGdx.jar files to my desktop and android projects.
Decision:
Right-click the project> Open Module Settings> Libraries> Small green button (New Alt + Insert Project Library)> Java>, and then select the libGdx.jar file. After that, you should include this library in your desktop and android projects.
Do not close the window, select "Modules"> "Android"> "Dependencies"> "Small green button"> "Module dependency" and select the main project. Do the same for the desktop and click OK.
That's all. All my projects work correctly.
Here is a tutorial with images. It also explains how to run a working project on the desktop.
http://imgur.com/a/IBFIV
source share