There should be a Folder named like your Game Title. Expand it. In this Folder Structure you will find cpp->MyGame->Classes. There you will find all header and source files.
The Simulators work fine. Just create one with the AVD-Manager. Your PC/Mac should have enough memory. otherwise it will be slow. Testing on Device is faster/better. I would recommend to use real Devices for testing purpose.
Eclipse is no longer supported by Google. So Android Studio is the way you have to go. At first I preferred xcode too (I also started with IOS)… but Android Studio now has the same quality.
I wouldn’t use wildcards for cpp files, but headers are fine. I use often one header and platform specific implementations (eg. class.h, class-android.cpp, class-ios.cpp, class-macos.cpp, class-windows.cpp and class-linux.cpp). Do you have a good solution for that, without moving the cpp files outside of the Classes folder? Because I have to add new files manually in XCode/Visual Studio, I also can add them to CMakeList for Android and Linux as well.
Dragging the cpp files into the left panel doesn’t seem to be working
I’m a on mac running El Capitan; Cocos2d-x version is 3.14.1; Android studio version is 3.2.1.
I read the it is possible to compile from the terminal using this command
cocos compile -p android --android-studio
I get this error: ANDROID_SDK_ROOT not defined. Please define it in your environment.
(I don’t think it is related to the missing Classes subdirectory issue)
If I hit the play button on Android studio it opens up the simulator (I grabbed a Nexus I think) but the app doesn’t work (It’s a fresh new cocos project)
maybe you should create a clean (default) project with cocos-console. for testing purpose.
or:
You could try to add Andoid sdk and ndk location in project setting. right click
YourGameTitle in the treeView and choose “Open Module Settings”. In the left menu select “SDK Location” and set the correct paths for sdk and ndk.
Don’t forget to download missing sdk versions and dependencies (SDK Manager).
In your case Android Studio has not fully synced you project
After successfully syncing and building you will see cpp-files in the file-tree. At least you will see a “cpp” Folder and cpp-files that came with cocos2d-x. Next step would be to edit Android.mk to add your own cpp-Files to your Project (but thats the next step).
Every time I create a new project, Android studio complains about the gradle version and a missing line (google()) in some configuration files.
I fix that adding google() in build.gradle
then I follow these instructions:
Is it possible that, in order to get Android studio working with Cocos2D-X, I have to install Android studio and the SDKs first and Cocos only after they are set?
I used to think that XCode configuration and its plist file were a mess…
You can also use “Open Module Settings” (for your Game) to change/view your Gradle Settings. Just select “project” in the left menu panel.
If have cocos2dx 3.17 and the following Gradle Version:
Then you have to replace every “compile” with “implementation”.
Look in the treeView under “Gradle Scripts” there is a build.gradle (Module: YourGameTitle).
At the bottom of this file is dependencies { … }. replace all “compile” with “implementation”.
or
you right click your project and again open module settings. Select your Game Module and open the dependencies. there are dropdowns for ever external lib… select implementation for every lib and you it’s done!
If you have included all needed dependencies then syncing will not fail anymore.
If some versions of libs or sdk’s are incompatible Android Studio will prompt you to update… wait until syncing is done or Android Studio prompts you to update something.
before I give it a try I want to re-install Cocos2dx and give the correct paths when asked.
The installation process asks for the NDK_ROOT
I pasted what it seems to be the path /Users/mandarx/Library/Android/sdk/ndk-bundle
Then it asks for the ANT_ROOT which I don’t know what it is (now I do)
But I don’t have any Apache Ant library installed.
Is it a prerequisite for Android developing with Android studio?