There was an old project where, to solve Google’s 64-bit requirement, I was about to upgrade cocos — then found out I didn’t need to. Apparently you just need to compile a 64-bit version. I vaguely remembered deleting arm64-v8a back then.
Google’s guide: https://developer.android.com/distribute/best-practices/develop/64-bit#test\_your\_app\_on\_64-bit\_hardware describes three scenarios — building with Gradle, with CMake, and with ndk-build — and they differ. Based on my testing, cocos2dx uses the ndk-build mode, which depends on the PROP_APP_ABI setting in gradle.properties.
// Your app’s build.gradle
apply plugin: ‘com.android.app’
android {
compileSdkVersion 27
defaultConfig {
appId "com.google.example.64bit"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86\_64'
// ...
Post: [Support for 64bit on cocos2d-x on Android](https://discuss.cocos2d-x.org/t/critical-support-for-64bit-on-cocos2d-x-on-android/45516/14):
in Application.mk:
APP_ABI := armeabi armeabi-v7a arm64-v8a
In gradle.properties:
PROP_APP_ABI=armeabi-v7a:arm64-v8a
In build.gradle(Module: myapp):
abiFilters ‘armeabi-v7a’, ‘arm64-v8a’
What I actually did:
1. Changed the config to add arm64-v8a
PROP_APP_ABI=armeabi-v7a:arm64-v8a
2. Upgraded Gradle and studio, raised the minimum sdk to 16 and the compile sdk to 28 3. Rewrote some Java code, deprecated method 4.
APP_STL := c++_static
arguments ‘NDK_TOOLCHAIN_VERSION=clang’
6. All the compile statements were no longer supported, so I changed them to implementation or api
dependencies {
implementation fileTree(dir: ‘../java/libs’, include: [‘*.jar’])
}