How to use Android Studio with Cocos2d-x

ⅰ亾dé卋堺 提交于 2019-12-12 08:29:36

问题


I work as an android programmer for just under a year now, and I just started to learn about android game development. The framework I choose to work with is Cocos2d-x.

I have seen guides and tutorials on how to use Cocos2d-x with eclipse, but I'd really like to know if it's possible to be used with Android Studio.

From what I've read, it is now possible to build NDK projects with gradle in Android Studio, which is good news. Nevertheless, I have yet to find any information about C++ programming using Android Studio. Eclipse uses the CDC ( https://www.eclipse.org/cdt/ ) plugin to achieve this.

Is there anything similar to be used with Android Studio? I have found some C/C++ enabling plugins for the IntelliJ Platform, but they were no longer updated.

Has anyone else tried this before? Did it work? Can you provide a step-by-step guide, for a newbie like me, who's dealing with this kind of problems for the first time?

Thank you for you time,

haxm


回答1:


Android Studio currently isn't well set-up for native programming. While the build system supports the NDK, there's no editor support for C++ files (it's not as if it won't work, but the IDE won't give you any editing assistance), and neither is there any debugging support. JetBrains has announced that they're working on new C++ support for IntelliJ, and this is something we're looking at for Android Studio, but it's not on the roadmap yet.




回答2:


Recent version of cocos2dx v3 (from github for example) have proj.android-studio project

At this moment I have no success to build it but maybe in future it will be fixed




回答3:


I just went through the setup for this example code. The project compiles and has a ton of sample code. Scott Barta's answer still stands as an important caveat, but wanted to share the link in case it was useful.

I also found this useful for some NDK background/how-to.



来源:https://stackoverflow.com/questions/22112387/how-to-use-android-studio-with-cocos2d-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!