Android developers: use Visual Studio!

Android developers: use Visual Studio!
0.0 0


Please check file proj.visualstudio\Cocos2dcpp\Cocos2dcpp.vcxproj : string
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
$(VS_NdkRoot)\sources\android\cpufeatures;$(VS_NdkRoot)\platforms\android-19\arch-arm\ - I think it should be x86 instead of arm
The same for …$(Platform)'=='Release|x86'"> string.


I did it, it costed me a week: SDKbox V2.3.2.0 for Visual Studio for cocos2d-x-3.13.1 :

How you can play with it:

  1. Create Cocos empty cpp project;
  2. With console=cmd import into project sdkbox AdMob;
  3. Merge project with “sdkbox-sample-admob” example (google for it);
  4. Make sure you can successfully build and run it on the device - (test) advertising should appear;
  5. Then you can add unzipped proj.visualstudio_sdkbox_for_cocos2d-x-3.13.1 (make its name shorter) folder into project. - here is very short zip with key differences, with test AdMob id.

Upd: but my AdMob sample doesn’t work on my Android 2.3.6 devices… :frowning:

Sdkbox inmobi crashing

Hello, I’m tying to add fmod precompiled library. I’ve added the and libraries to linker addtional dependencies, also updated the include paths and everithing compiles fine but hangs after deploy because libraries are not installed in the system.

Also added fmod.jar to the project and project libs folder, same place android-async and other .jar

dlopen("/data/app/com.CocosVisualStudio-2/lib/arm/", RTLD_LAZY) failed dlopen failed: could not load library "" needed by ""; caused by library "" not foud.

So my quiestion is wich and or or whatever have to edit to deploy the library with my project. I’m not Android expert at all and really struggling with this. Thanks a lot.


Is there some sort of android simulator like when using eclipse? I mean right now it is just making a window that has the design size…


Answered myself in a new thread think is big enough:


@IanHu: Could you (or someone else) please help us to add Google Play Services into VS-2015 project (to debug it on Android device from VS)? I’ve tried but no success.



I am using windows 10, cocos 3.13.2, ndk-r11c, apache-ant-1.9.3, jdk1.7.0_55, jre1.8.0_73

  1. I cannot get visual studio to detect my 2.3.5 Samsung Gingerbread phone. Can anyone help me do this?

  2. i get these errors when i build…can i get help on how to fix this?

    1>…\cocos2d\cocos\audio\android/AudioEngine-inl.cpp(177): error : undefined reference to 'cocos2d::experimental::AudioPlayerProvider::AudioPlayerProvider(SLEngineItf_ const* const*, SLObjectItf_ const* const*, int, int, std::function<int (std::string const&, long*, long*)> const&, cocos2d::experimental::ICallerThreadUtils*)'
    1>…\cocos2d\cocos\audio\android/AudioEngine-inl.cpp(195): error : undefined reference to 'cocos2d::experimental::AudioPlayerProvider::pause()'
    1>…\cocos2d\cocos\audio\android/AudioEngine-inl.cpp(209): error : undefined reference to 'typeinfo for cocos2d::experimental::UrlAudioPlayer’
    1>…\cocos2d\cocos\audio\android/AudioEngine-inl.cpp(217): error : undefined reference to 'cocos2d::experimental::AudioPlayerProvider::resume()'
    1>…\cocos2d\cocos\audio\android/AudioEngine-inl.cpp(242): error : undefined reference to 'cocos2d::experimental::AudioPlayerProvider::getAudioPlayer(std::string const&)'
    1>…\cocos2d\cocos\audio\android/AudioEngine-inl.cpp(407): error : undefined reference to 'cocos2d::experimental::AudioPlayerProvider::preloadEffect(std::string const&, std::function<void (bool, cocos2d::experimental::PcmData)> const&)'
    1>…\cocos2d\cocos\audio\android/AudioEngine-inl.cpp(428): error : undefined reference to 'cocos2d::experimental::AudioPlayerProvider::clearPcmCache(std::string const&)'
    1>…\cocos2d\cocos\audio\android/AudioEngine-inl.cpp(436): error : undefined reference to ‘cocos2d::experimental::AudioPlayerProvider::clearAllPcmCaches()’


@IanHu In the template for v3.13.1 from your blog, we have to copy all the resources to the “assets” directory inside the “Cocos2d” directory , or else the project will throw the segmentation exception.
I made a small change, the project is now linking all resources in Resources folder when loading projects, so it would be much easier to use.
Beside that, I created a small python script to rename to dedicated project name also. You can check it here:


Is it posible to use this with cocos 3.14.1? Thanks for such a great work.


I am not sure. I haven’t tried. I can email Ian at Microsoft and ask him if he can ensure compatibility.


Well, if not i’ll try it myself in a few weeks when i start the services side with sdkbox, hope can integrate it with relative ease using the info on this thread. I’m already using another precompiled library, fmod, and integrating it was a bit of a pain. (see my post in this same thread).


By the way, in my opinion, the andorid visual studio project is super useful and should be part of the official cocos releases.


Can I +1 the request to make this work with 3.14.



am having setup and build issues could anyone help please.


Can anyone share a how-to of Visual Studio project VC++, Linker etc. settings ? I have never got it built using Visual Studio 2015. Not a single time.