I am trying to get a port from Sprite-kit, to Android going before next Saturday, but I cant even get cocos2d going!
I have tried twice now with two different tutorials and almost always get stuck at some error that on forum posts everywhere has yet to have a resolution that fixes it for me. Generally this is because the new ndk has a linking issue, or google now shoves android studio in your face and hides the sdk and tools. Basically all of these tutorials seem to only work if you have the magical versions of everything that existed at the time of creation… now (idk it could just be me) but things just dont seem to be working!
Anyway I was hoping for a suggestion of what tutorial I can try next. Preferably the tutorial would come with all of the SDK, NDK, etc. files that were used in the tutorial so that I dont have to use updated ones. I would prefer a print one, but it has to be thorough.
Any ideas?
I have given up on the last attempt because eclipse started to go really wacky which compouneded the other issues, however if try 3 doesn’t go well I will be asking for help if that is ok.
P.S this is the tutorial I used this last time it is from 2015 which is pretty recent, however a lot of things have changed versions and placements.
If you are running into trouble, we also need to know what is going on. I get you are frustrated, but without seeing an error or screenshots or something, I’m not sure how to help more.
The tutorial you link to is not an official tutorial, so I cannot say for sure if it works or not.
You should prefer apache ant version 1.9.6
android ndk version 10
And its not that tough to install, I will be linking the youtube link where it has been installed.
the version might be different but this way works. https://www.youtube.com/watch?v=xqtT0E68TJM
That might be just a warning kind of thing. Try to compile it before and the run it.
Even if it might be showing “Please use cocos console instead” the programs runs well.
I was also getting the same message when I was using eclipse for cocos2dx game development.
Go into your project directory through cmd.
then compile your project using this command “cocos compile -p android --android-studio”
It will take some time and finally a new folder will get created in your project director name “bin” then open that folder and you will get your .apk file there.
copy it on your phone and install it.
First of all add path of sdk and ndk in environment variable(You must have already done that).
Sdk version is 22. It is the best version to use with cocos2dx.
ndk version is 10. I was using version 9 till few weeks earlier but now cofigured it to 10.
environment variable ex:
ANDROID_SDK_ROOT - C:\Cocos\Android SDK\sdk
ANT_ROOT - D:\Cocos_Setup\apache-ant-1.9.6\bin
NDK_ROOT - D:\Cocos_Setup\android-ndk-r10e-windows-x86_64\android-ndk-r10e
you can use the path where you have stored these data.
After that make a new project using console:
cocos new AnyName -p com.anything.AnyName -l cpp -d C:\AnyDirectory
Wait a minute and it will create new project.
Then go into your project directory(AnyName) find foder named android type cmd in address bar then run the command build_native.py
It will take some time and you will get the message Build Successful.
Then go into your Project folder then folder named “bin” and you will find “AnyName.apk” there. Install it.