iartist93
iartist93

Reputation: 335

Can't compile Cocos2d-x project

I've just installed Cocos2d-X and whenever i try to compile newly created project i got the following error.

I tried to uninstall and install java again and nothing changed.

I'm using the following command to compile.

> cocos.py compile -p android --android-studio

And i got the following Error :

 FAILURE: Build failed with an exception.                                                                                                                                                                              
* What went wrong:                                                                                         
A problem occurred configuring project ':libcocos2dx'.                                                     
> Failed to notify project evaluation listener.                                                               
> javax/xml/bind/annotation/XmlSchema                                                                                                                                                                              
* Try:                                                                                                     
Run with --stacktrace option to get the stack trace. Run with --debug option 
to get more log output.                                                                                                                  
BUILD FAILED

and sometimes i get this error

> Could not initialize class com.android.sdklib.repository.AndroidSdkHandler

instead of

> javax/xml/bind/annotation/XmlSchema                                                                                                                                                                              

Upvotes: 1

Views: 481

Answers (2)

mavios
mavios

Reputation: 230

From what I understand command line compile doesn't work for android-studio anymore. Best way is to try install latest android-studio and latest cocos2d-x. Then build apk and test on device... First time you run android-studio it will download few things. And first compile for a projct will take ages.. but after that everything will be pretty fast

Upvotes: 0

Perrin255
Perrin255

Reputation: 489

I had a similar problem. For me uninstalling java 9 and installing java 8 did the trick.

If you are in Android studio you could go to File -> Project Structure and change the JDK Location to wherever you have java 8 installed

Upvotes: 1

Related Questions