Cocos2d-x – libcocos2dx.jar missing, classes.jar

Datetime:2016-08-23 04:30:37         Topic: Cocos2d-X  Java          Share        Original >>
Here to See The Original Article!!!

Apologises for the newbie query.

Trying to debug my first Cocos2d-x project, Mac (new to me), Eclipse, Cocos2d-x 3.7.1. I have imported the main project, the cocos2d-x library and converted the main project to a C/C++ project.

When I build the project from the terminal (any of the proscribed methods; build native, cocos compile or ndk-build) I get the expected libcoco2dx.jar file and a successful main build.

When I build the cocos2d-x library project from within Eclipse (right click libcocos2dx -> build) I get the expected libcocs2dx.jar output.

When I build my main project from within Eclipse, the libcocos2dx library is also rebuilt but the output is ‘classes.jar’.

Trying to debug the main project builds everything ok according to the console output but I get an error reported in the problems tab – ‘The import org.cocos2dx.lib’ cannot be resolved.

I guess there are two fixes (at least):

Remove the current import reference to libcocos2dx and then copy the correctly built libcocs2dx.jar file to another location and reference this. I cannot seem to find how to do this.


Fix the build which is currently using which employs cocos compile (I understand) which uses ant. I have seen comments blaming ant but I do not understand the script/build structure so I cannot fix (again).

Any explanations or fixes would be most appreciated!



Put your ads here, just $200 per month.