Hi all, the github latest codes supports Android Studio. More information can refer to this issue.
Usage
You can just use Android Studio to open the proj.android-studio folder(such as cocos2d-x/cocos/tests/cpp-tests/proj.android-studio), then click the run button to build an run. You can also debug the c++ codes too.
limitation
Can not use cocos command to compile the Android Studio project, work in progress.
Can not view cocos2d-x cpp files in Android Studio which means can not debug engine codes directly, but can step into it. It is the bug of Android Studio, and Google developers said it is fixed in Android Studio 2.3. I haven’t tried it.
You are appreciated to test and report any bug. Thanks.
@jake72 no, currently Cocos Creator projects doesn’t support it. Will support it later. @mars3142 we may change to use cmake after refactoring cocos2d-x cmake files. @piotrros Really? Did you do anything special?
It’s a slightly modified configuration from a pull request.
In my case I’m not seeing cocos files (only my own cpp files), because I’m using precompiled version, however at some point I had a version where I could see them, so it’s for sure possible.
Could you please include fix for multiple APK(when set in gradle to generate multiple APK with different ABI) , right now cocos command generating multiple APK’s but moving only one of them to main build/release folder, so we need manually go to app/build subfolder and get other generated APK’s. With gradle support it is now common scenario when user generating multiple APK’s at once and cocos should support it by default.
The issue is not the compiling (different ABI and productFlavors). The issue with the cocos command is the copy of the APK at the end into the build folder.
After this patch, if using cocos command to compile proj.android-studio project, it will not copy the APK any more. Did you mean use cocos command to compile proj.android(the project doesn’t support Android Studio)?
I’ve updated compileSdkVersion to 25, buildToolsVersion to 25.0.1, gradle version to 2.3.0. I don’t get this “PROP_NDK_NODE” stuff so I’ve removed all if’s in gradle file. Now I can see all cpp files: