Cocos2D-x - Cannot compile for Linux and Android crashing in 3.16

Hello!

I can’t find a way to compile a project, that works on iOS, on Linux and the app that does compile for Android crashes instantly. I am saddened by the lack of maintenance the project gets when it comes to the actual platform management.

I have been sitting with Android Studio for several hours today without actually getting my game to work at all on Android, and it runs fine on iOS. On top of that, I can’t compile a Linux version at all. For that I use version 3.13.1 where I symlink the Classes and Resources folders in order to not have duplicated code. That I can compile for Linux, but not iOS. Have not tried Android though.

The idea is to have the game on iOS and Android only, so Linux is just for me to play-test. But right now nothing works. I’m going to have to drop the use of Cocos2D if I want to do this. Which is sad, because it’s basically the only liable C++ engine out there with a wide support.

Is there any work towards fixing these issues at all? I can’t be the only one experiencing this, can I?

sorry, where do you come off saying this?

I get that you may be frustrated but coming off like we are broken isn’t fair when you want help.

First, what Linux OS?

Second, what version of Android Studio?

Third, can you compile a project from cocos new ...?

Fourth, can you show me error messages, etc?

What version of Cocos2d-x will you be using for all versions? Symlinking is a good idea. I do this with a lot of files across many games I have written.

I recently tested Android Studio and didn’t have any issues. So let’s work through your problems.

It does not compile for Linux or Android using the CLI. cocos run -p android . complains that the Eclipse project is unsupported since some version of a part of the SDK.

Using the --android-studio flag doesn’t change anything because it does not run out of the box and I had to tweak for hours.

The latest version of the CMake version does not work either, and there are several complaints about it in the forums. I asked a long time ago myself regarding that one, and was told something along those lines myself. That all platforms don’t get the same amount of attention and that things tend to break. So I downgraded to 3.13.1 (the latest version I knew worked), and it worked again.

I am using Arch Linux as my OS. But these experiments (except for the Linux one) were run on macOS Sierra.

And for the Android build, I managed to get it to run eventually by further tweaking (can’t remember the steps) but it only works on my actual device, and not in the emulators, no matter the architecture of the image.

So, compiling with cocos run -p <linux/android> . does not work in 3.16, or if I change to 3.13.1, it does not work for iOS due to iOS 11 updates.

I could however compile through Android Studio after tonnes of messing around, but ONLY on my real device, a OnePlus 5.

iOS worked out of the box, so that’s good, but since I’m not an iOS user it wouldn’t help me if I didn’t get Android up and running.

As for logs, no need. I can live with Linux not building for now and I’ll just have to make sure to keep the Android version up to date every now and then. I’ll do all the actual work in XCode as that simulator works.

And out of curiousity, are the build servers they are using available? On GitHub you can’t see the current build status.

a lot of what you are saying is what we know already.

  • Eclipse is deprecated -> use Android Studio
  • Command-line development is deprecated in v3.15 and v3.16 due to Android SDK removing the android command-line tool -> use Android Studio
  • We do not test on Arch only Ubuntu, Make sure to run build/install-deps-linux.sh
  • Android Studio on High Sierra does work. I tested it very recently.
  • Emulators in Android Studio work better than Eclipse or command-line envs ever did but testing on real hardware is the absolute best approach.

You should be able to run cocos new and compile on each platform out of the box.