Here’s my (so far unsuccessful) experience using the latest installation instructions while trying to install the current tools for a new C++ cocos2d-x 3.16 project using Android Studio v3.0.1. I’m using the same Mac with High Sierra that was used for making my last game, which used Terminal commands to build for Android. But since Terminal commands no longer work for building cocos2d-x for Android, I’m now switching to Android Studio.
I stumbled across several different errors trying to build and run CppTests. The instructions don’t tell you that you need to import “build.gradle” to load a project into Android Studio, but I remembered this from my previous attempts at building cocos2d-x in Android Studio in the past. (Hint: instructions for running CppTests should mention build.gradle). Anyway, after trying lots of different things and searching online for clues as to the causes of my CppTests building problems, I ultimately decided that the PATH and environment variables that I set up for my previous Terminal-based project in .bash_profile were probably interfering with the operation of Android Studio. I therefore commented out every line of .bash_profile. Then I rebooted, completely uninstalled Android Studio using instructions at howchoo.com, and installed a fresh copy. I also got a fresh copy of cocos2d-x.
So now that I had a “clean” environment to work with I proceeded to build and run CppTests using the emulator for a Nexus 6P with API 25. But it is still failing with errors that give no clear indication stating how to fix them. A popup box says: “Application Installation Failed: … Failed to Finalize Session: INSTALL_FAILED_NO MATCHING_ABIS: Failed to extract native libraries, res = -113.” And in the Messages Gradle Build window is a red-error-circle on the line that says: “Android NDK: Application targets deprecated ABI(s): armeabi”. See this screenshot.
Why does this happen with a clean build, and what do I do to fix it? And how can you improve the installation instructions so that others don’t stumble here as well? If you want to attract new users to Cocos2d-x, it is important to give clear directions on how to get started, so that they don’t get discouraged and decide to try out other multi-platform environments like Unity.
Thanks for taking a look at this!