I don’t want to use pre-builts for android. It’s all time pain. I’m done… I updated my previous post. There are questions what to do and missed info…
upd.: okay I was able to built new and empty project. Now I’m trying as usually drag and drop my source code files like in Xcode, to the project folder Classes but got an error : Cannot move. How to add my source code cpp files into the project?
Also, where there are no proj.android-studio but only proj.android ?
p.s. actually I’m trying to compile for android all this day, it’s still can’t be compiled. So awkward tool as android) well, I don’t have a choice and need to build my game for it…
I typed that I don’t want to use it. At topic title and in prev. post. I want to use ANdroid Studio and there are post about this question of how to actually, I can’t even add any file into it…
no, we not using prebuilds as it always problem compiling them. Regarding Java 9, yes we also faced that issue on new mac when by default wast installed latest java version, downgrading to java8 fixed issue with compile with older gradle.
I’ve got some success with compiling an empty project. But what I’m trying to do next, is move cocos2d-x folder outside, but can’t compile with such config.
This works well:
settings.gradle project(':libcocos2dx').projectDir = new File(settingsDir, '../cocos2d/cocos/platform/android/libcocos2dx')
It could be that there is some module inside which can’t find other module due u moved cocos2d-x folder and it looking for relative/absolute path.
Are u sure that u not getting more output in log? Havre atry compile thru console not Android-studio.
Also it could be due u have cocos2d-x - minus sign inside name, this import-add-path for me is tricky need to have clear view what they do where folder located and so on.
What is reason to move cocos2d-x outside project, u want to safe space or use it to other projects? in this case i recomnd to use symlinks or submodules -depends on how u want to store it.
Heh, I figured out it. Thank anyway for your suggestions.
I just removed folder build manually: /Volumes/MacData/GitProjects/TestGame/proj.android/app/build
When I used Clean Project in studio, it’s not worked. Seems like when I build before with cocos2d folder inside project root, there happened some glitch… when changed paths… studio probably thinks that cocos inside project root, but as I removed it after changed paths, got that error.
Yes and for me this should be like a general idea for using cocos2d-x. A lot of savings for space everywhere, from git to local and speed of building. By the way, are you using ccache? I’ve installed it but after compile in android studio my it’s cache is 0…
good to know, also regarding that android-studio compile vs console, I was trying to upgrade to gradle 3+ in cocos2d-x and there was real mess with studio ;/ cocos for now doesn’t work properly with it, so just in case don’t update it.
For ccache we heard about it, but we for now don’t want to use it as it’s not clear if u compiling really latest code or not and for us it is very critical to be with full control over your code and understand what happening with build.
For this space saving - I really recomnding for you to try submodules, just add repo with cocos2d-x folder and then use it as submodule for new projects where it will be checkouted to cocos2d folder.
Honestly I’m not familiar with android, but I think I’m using all latest? distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
…
But all looks ok for me, build succeeded. But will keep my eyes on it
Yes, it’s will save git, but not locally anyway, plus this build folder, currently for example for my game it’s 2.32Gb if use cocos2d-x folder with git inside project it will add more 2.75Gb. So more than 5Gb for only 1 game.
Yeah, u upgraded to latest one, so far I had issue compiling thru console so I’m assuming u didn’t faced it because compiling with android-studio. For me it also not clear yet how stable apk this new gradle making and if there is any benefits using it.
For that issue then probably u could try also symlink.
Add cocos2d-x to git, then checkout out it to specific location as cocos2d, after making new project make symlink with reltive path to that cocos2d folder and then u can use default project setup, but it is almost same as u doing now - you just no need to change that default config files - so it is up to you how you feel it is easier for you.
I see, well, I’m currently developed only 1-st level for my game, of I hope 100 levels so it’s a long time, will test all this on myself.
And as currently I’ve done build with external cocos2d-x folder - everything is ok for me.
Now I know, that cleaning built folders and cache for that android studio is 1st task ever. Omg, tomorrow I will back to Xcode and perfect and ideal development process… today all day with android was like too much stress for me lol.
biggest mess was for me with cache, when devs was making changes like for 2 days in project and when i checkouted project - compililer somehow made build by mixing latest and old files - so I had strange build with some new and old functionality - until I deleted build and extranealndk folder it was mixing classes
btw we now experimenting with cricket audio engine, it seems working in cocos2d-x so maybe would be very good alternative to default one
FMOD is the best, all optimizations and stability. Some weeks ago I’ve found some audio engine free and with remark: its ok but not so fast and cool as FMOD, but you can use it as beginning… probably should create a new topic to talk about audio engines… I can;t find what that engine was… but it’s free and open source as I remember…