Android developers: use Visual Studio!

Hello Android Developers!

I am pleased to let you all know that our friends at Microsoft have made is possible to use Visual Studio to develop Android based Cocos2d-x apps!

Check out this blog entry: https://blogs.msdn.microsoft.com/vcblog/2016/07/12/cocos2d-x-visual-studio-android-project/#comment-152585

I tested it and it works! You must be on v3.12. Any version newer (GitHub repo) or older (< 3.12) will not work. It must be v3.12.

3 Likes

This is great news, I look forward to trying it out! debugging Android has always been a pain in the ass :stuck_out_tongue:

1 Like

What about Mac users?:slight_smile:

1 Like

How to use it with cocos js

Its indeed great news, but it doesnā€™t support auto-complete. :disappointed:
It will be complete if we have auto-complete with C++/SDKBOX-plugin/Java part

can it still be used with web?

How can I install it on mac :smiley: ? Iā€™d rather use android studio, but not yetā€¦ still alpha version has serious problemsā€¦

1 Like

Hey everyone. If slackmoehrle doesnā€™t mind me chipping in. Iā€™m the developer at Microsoft who worked on this. As slackmoehrle noted this project only works with a specific version of Cocos currently (itā€™s not integrated with the Cocos template system). However it is fairly easy to upgrade to newer versions, so I plan on continuing to support it for new Cocos versions when released. If you have any feedback on it, bugs, missing things, comments on the overall Visual Studio Cocos Android development experience, or anything of the sort Iā€™ll watch the thread here, the comments on the VS blog post and I can also be reached by e-mail at ianhu@microsoft.com.

@smitpatel88. By auto complete do you mean that Intellisense was not working? Was this for the entire project?

2 Likes

Yes, Intelisense is not working for entire project.

Iā€™ll take a quick peek at the local copy that I have and see if I can see what is going on.

edit: As a heads up, it might be early Monday that I can look at this.

It was already possible (and convenient) ā€œto use Visual Studio to develop Android based Cocos2d-x apps!ā€, now we get to use device debugging tools afaikā€¦

and the ability to use VS to target Android and your Windows 8, 10, phone needs as well. No need for other tools.

@IanHu Thank you again so much for this! I added a title to your profile. PM me if you want it changed.

@smitpatel88.

Currently autocomplete looks ok on my box.

Lemme ask around with the IntelliSense team to see if there is some diagnostic output that we might be able to get for why you are not seeing it. Annoyingly issues with this can be pretty hard to diagnose as I donā€™t have a local repro or a project that you could share with me to look at.

This seems great Iā€™m gonna make some tests, I hope it also support third party libraries for ads, analytics. Iā€™m starting to get bored with eclipse for this :frowning:

is CLang compulsory?
I am getting below 3 warning on opening project

warning : The build tools for Clang_3_8 cannot be found. Install Clang_3_8 to build using the Clang_3_8 build tools.
warning : Platform ā€˜[ARM, 0]ā€™ referenced in the project file ā€˜Cocos2dcppā€™ cannot be found.
warning : Platform ā€˜[x86, 0]ā€™ referenced in the project file ā€˜Cocos2dcppā€™ cannot be found.

Itā€™s working well so far and actually produced a build that works flawlessly on a version of android that I was getting random Fatal signal 11 errors while building using the cocos command line. Great!

Two questions.

  1. Exactly which files have to be renamed in the Visual Studio project? Currently it installs as ā€œCocosVisualStudioā€ on Android.
  2. I noticed that it uses itā€™s own Asset directory instead of the Resources directory that the rest of the projects share. Itā€™s not a big deal as I just copied them over but it will be harder to manage two directories. Was this intentional, or did I miss something obvious where it should be using the Resources folder?

Thanks so much for this, itā€™s so incredibly helpful. Debugging Android NDK was going to be the death of me!

Very cool.

Cannot compile my project which uses SDKBOX:

proj.visualstudio\Cocos2d\ARM\Debug\Package\src\org\cocos2dx\lib\Cocos2dxActivity.java:375: error: cannot find symbol
2> [javac] if(!SDKBox.onActivityResult(requestCode, resultCode, data)) {
2> [javac] ^
2> [javac] symbol: variable SDKBox
2> [javac] location: class Cocos2dxActivity

Any hint on integrating SDKBOX with this?