First of all, thank you for working on this setup for our community. This could be the way to go in the future.
Two more questions about the whole Visual Studio Setup:
I’ve seen that you use Ant in the project. Many modern frameworks (like the Facebook / Firebase / etc.) require Gradle to work. Also Android Studio uses Gradle and Google greatly pushes it for Android. Is it possible to use Gradle in Visual Studio for this Setup?
Is it possible to use this together with the Visual Studio Xcode syncing feature (https://msdn.microsoft.com/en-us/library/mt748656.aspx) to have one project for Android and iOS in Visual Studio?
This would be really awesome and be a revolution for cocos2d-x developers.
Had to change the default values for android sdk, ndk, java and ant in visual studio / tools / options / cross platform, but now works great!!
Using cocos13.3.1. Can deploy to android device, do remote debugging, intellisense also works well, i’m sharing the source files with the other builds and also sharing the assets, to do this deleted the assets folder and created a hard folder link (junction), from windows command type: mklink /J assets C:\wherever\you\have\cocos\project\Resources
I can deploy to my arm device with no problem but i can’t deploy to any avd x86 emulator, visual studio does not detect it, don’t really know if this is expected to work. Anyway, many thanks again.
@IanHu Thanks a lot, commander; but seems your vscocosandroidsamplesdkbox is for sdkbox V2.2.5.3 ; and there appeared newer: V2.3.2.0 could we please have newer pack?
Hello @nite and @IanHu, I think I’m close to use SDKbox & Visual Studio, but I need help.
Windows-7, VS-2015, cpp, Android:
I successfully build & run my apk (it uses AdMob ) in both cmd and VS. In cmd it works properly, if there is a line <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> in AndroidManifest.xml; but I can’t build it in VS - it needs google_play_services_version value, Q: how should I properly input that value into my VS project? Thank you. Upd: I’ve get it; anyway my “AdMob” app shows the result (test advertising), if apk created with cocos compile ... and do not even try to download test advertising if apk created with VS Upd: I’ve got it working (in VS-2015); going to update after max cleaning.
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.
Hello, I’m tying to add fmod precompiled library. I’ve added the libfmodL.so and libfmodstudioL.so 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/libcocos2dcpp.so", RTLD_LAZY) failed dlopen failed: could not load library "libfomdstudioL.so" needed by "libcocos2dcpp.so"; caused by library "libfmodstudioL.so" not foud.
FATAL EXCEPTION: main
So my quiestion is wich Android.mk and or Application.mk 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.
@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.
@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:
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).
Hi all !
A long time ago, I helped to make the VS solution, based on cocos2d-x 3.13.1, to work on VS 2015. My game project were in “StandBy” but since last week, I tried again to make it work… But I don’t succeed in making it working again !
I updated my environment : I use VS 2019 (Community), android NDK R15c, Java JDK V12.0.2 and ANT 1.9.3.
So with this configuration, if I compile the solution downloadable for version 3.13.1, I have this error
2>-compile:
2> [javac] Compiling 2 source files to C:\oponsinet\Development\MobileApps\Download\proj.visualstudio-3_13_1\proj.visualstudio\Cocos2d\ARM\Debug\Package\bin\classes
2>EXEC : [javac] error : Source option 5 is no longer supported. Use 7 or later.
2>EXEC : [javac] error : Target option 5 is no longer supported. Use 7 or later.
2>
2>BUILD FAILED
2>C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:716: The following error occurred while executing this line:
2>C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:730: Compile failed; see the compiler error output for details.
To prevent this error, I found this solution : add these 2 lines in build.xml :
But, problem, when I add these 2 lines, I no longer have this error, but I have some new errors :
2> [dx] -Djava.ext.dirs=C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.3\lib is not supported. Use -classpath instead.
2>EXEC : [dx] error : Could not create the Java Virtual Machine.
2>EXEC : [dx] error : A fatal exception has occurred. Program will exit.
2>
2>BUILD FAILED
2>C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:888: The following error occurred while executing this line:
2>C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:890: The following error occurred while executing this line:
2>C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:902: The following error occurred while executing this line:
2>C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:283: null returned: 1
2>
So I don’t know if somebody has seen this error, but when I tried different solutions found on different forums, there is no solution wheich works !