V3.13+ Build Requirements

According to this page: http://cocos2d-x.org/docs/installation/A/index.html these are the prerequisites for building v3.13 and v3.13.1

Build Requirements
v3.13, v3.13.1

Mac OS X 10.7+, Xcode 7+
Ubuntu 14.04+, gcc, CMake 2.6+
Windows 7+, VS 2013 or VS 2015
Python 2.7.5
NDK r11+ and API level 19 is required to build Android games
Windows Phone/Store 8.1, VS 2013 Update 4+ or VS 2015
Windows Phone/Store 10.0, VS 2015

I don’t understand this line (NDK r11+ and API level 19 is required to build Android games). How is API level 19 is required? The API level set in the template projects is 15… And minSdkLevel is 9. Also I’ve ran and used successfully my upgraded game to 3.13.1 with r10e NDK and Api 15. Can someone elaborate on this pleases?

@zhangxm can you help me understand this piece?

@slackmoehrle i think API level 13 is needed now.

@MatrixAndrew sorry about confused, i will explain it as i can. As you know, there are two parts of codes of Android native app: C++ and Java. We should compile these two parts of codes when generating a APK. And the API level will affect these two parts of codes:

  • For c++, the API level determine which folder in NDK_ROOT/platforms being used. Different folders includes different header files, and it may break compatibility if building with android-21 and running on a device with Android 4.4 or lower version.
  • For Java, the API level determine which folder in ANDROID_SDK_ROOT/platforms to be used. Different folders includes different Java classes or different API with the same Java classes. cocos2d-x supports Android 2.3+, so we should make sure cocos2d-x doesn’t use classes or API that are not defined in higher API level. So cocos2d-x should use as low API level as possible. Developers can change it if needed.

Why API level 13 instead of API level 10 are needed is because we need orientation feature to be set in android:configChanges in AndroidManifest.xml to prevent Activity been destroyed when devices orientation is changed. And the orientation feature is added since API level 13.

Hope it can help.

@slackmoehrle i think we should add a documentation about it. And feel free to connect me if you need any help.

3 Likes

So if API 13 is the needed minimum, why is API 19 mentioned in the requirements? And is NDK r11+ really a requirement as well?

I’ll make more changes to the wording on the Android install docs and ask you to take a quick look.

@MatrixAndrew we will modify the doc about API level. NDK 11+ is mentioned because we all uses NDK 11+ and haven’t found issues. We don’t have resources to test call NDK versions to give working versions. We always use latest NDK version if possible. For example, i use NDK 13 now.

@slackmoehrle thanks.