Cocos2dx v2.2.6 migration to Android studio

Cocos2dx v2.2.6 migration to Android studio


  1. Not build http & websocket (maybe rebuild old curl version to support http)





Oh! I see.
I missed ‘TODO section’

Thanks :slight_smile:



v1.0-alpha release

add libcurl and libwebsockets add Android arm64 support.
would you like help to test?



Hello, I tested, but build is failed.

First, Doesn’t exist ‘include64’ folder in libcurl forder.
Second, Doesn’t exist ’ libcrypto.a’,‘libssl.a’ each TARGET_ARCH.
Last. Doesn;t exist ‘libwebsockets.a’ and ‘arm64-v8a’ folder.

Just Copy from 3.XX engine? thanks :slight_smile:


#19 added, plz try again.



Build successed! But crash… :frowning:

I can see first scene a few second. but crashed.
I don’t know why…

2019-02-13 00:39:51.334 17270-17267/? A/google-breakpad: Microdump skipped (uninteresting)
2019-02-13 00:39:51.367 17054-17267/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x7a00000534 in tid 17267 (GLThread 2515), pid 17054 (stfantasy1super)
2019-02-13 00:39:51.488 17279-17279/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-02-13 00:39:51.488 17279-17279/? A/DEBUG: Build fingerprint: ‘google/bullhead/bullhead:8.1.0/OPM4.171019.016.A1/4720815:user/release-keys’
2019-02-13 00:39:51.488 17279-17279/? A/DEBUG: Revision: ‘rev_1.0’
2019-02-13 00:39:51.488 17279-17279/? A/DEBUG: ABI: ‘arm64’
2019-02-13 00:39:51.488 17279-17279/? A/DEBUG: pid: 17054, tid: 17267, name: GLThread 2515 >>> com.sosc.firstfantasy1super <<<
2019-02-13 00:39:51.488 17279-17279/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7a00000534
2019-02-13 00:39:51.488 17279-17279/? A/DEBUG: x0 0000007a00000000 x1 0000007a0c3d6840 x2 0000007a0676a484 x3 0000000000000000
2019-02-13 00:39:51.488 17279-17279/? A/DEBUG: x4 00000000ffffff80 x5 0000007a0676a260 x6 0000007a0676a2c0 x7 0000000000000034
2019-02-13 00:39:51.488 17279-17279/? A/DEBUG: x8 418bf65a522f7098 x9 418bf65a522f7098 x10 00000000000001cd x11 00000000ffffffff
2019-02-13 00:39:51.489 17279-17279/? A/DEBUG: x12 0000007a0d7b3a68 x13 ffffffffa39f4a24 x14 000c5d5d61000000 x15 003b9aca00000000
2019-02-13 00:39:51.489 17279-17279/? A/DEBUG: x16 0000007a13582520 x17 0000007aaaa3e2f0 x18 0000007aaaaf8000 x19 0000007a00000000
2019-02-13 00:39:51.489 17279-17279/? A/DEBUG: x20 0000007a135a2bb0 x21 0000000000000000 x22 0000007a0c7d3200 x23 0000007a0c2789d0
2019-02-13 00:39:51.489 17279-17279/? A/DEBUG: x24 0000007a0676a488 x25 0000007a0c2789f0 x26 0000007a135a2d30 x27 0000007a12fe10f4
2019-02-13 00:39:51.489 17279-17279/? A/DEBUG: x28 0000007a133782a0 x29 0000007a0676a3a0 x30 0000007a12fe08e0
2019-02-13 00:39:51.489 17279-17279/? A/DEBUG: sp 0000007a0676a3a0 pc 0000007a130ba7a4 pstate 0000000060000000
2019-02-13 00:39:51.493 17279-17279/? A/DEBUG: backtrace:
2019-02-13 00:39:51.493 17279-17279/? A/DEBUG: #00 pc 00000000005347a4 /data/app/com.sosc.firstfantasy1super-fNGe8esIftFk9aPstNK6RQ==/lib/arm64/
2019-02-13 00:39:51.493 17279-17279/? A/DEBUG: #01 pc 000000000045a8dc /data/app/com.sosc.firstfantasy1super-fNGe8esIftFk9aPstNK6RQ==/lib/arm64/
2019-02-13 00:39:51.493 17279-17279/? A/DEBUG: #02 pc 0000000000067d0c /system/lib64/ (__pthread_start(void*)+36)
2019-02-13 00:39:51.493 17279-17279/? A/DEBUG: #03 pc 000000000001eba4 /system/lib64/ (__start_thread+68)
2019-02-13 00:39:55.167 584-584/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_09
2019-02-13 00:39:55.210 428-428/? E/lowmemorykiller: Error writing /proc/17054/oom_score_adj; errno=22
2019-02-13 00:39:55.323 765-803/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 60)
2019-02-13 00:39:55.330 429-465/? E/SurfaceFlinger: Failed to find layer (SurfaceView - com.sosc.firstfantasy1super/com.sosc.firstfantasy1super.FirstFantasy#0) in layer parent (no-parent).
2019-02-13 00:39:55.330 429-465/? E/SurfaceFlinger: Failed to find layer (Background for - SurfaceView - com.sosc.firstfantasy1super/com.sosc.firstfantasy1super.FirstFantasy#0) in layer parent (no-parent).



Anyway, I wonder if this code is the correct code.
I built it without that code.




Has my hello project collapsed?



‘com.sosc.firstfantasy1super’ My project still use Eclipse.

Anyway, I tested your hello project.
iOS is build successed!
Android is build failed. I Think ndk setting is somthing wrong…


KwonDai-Hyunui-iMac:hello Zabob_Kwon$ cocos compile -p android --android-studio --ndk-mode release

Python 2.7.10

Building mode: debug

Using Android Studio project : /Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master/projects/hello/

Building native…

NDK build mode: release

running: ‘/Users/Zabob_Kwon/Documents/android-ndk-r10e/ndk-build -C /Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master/projects/hello/ -j8 NDK_MODULE_PATH=/Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master:/Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master/cocos2dx:/Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master/cocos2dx/platform/third_party/android/prebuilt:/Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master/external:/Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master/extensions:/Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master/CocosDenshion/android NDK_TOOLCHAIN_VERSION=4.9’

make: Entering directory `/Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master/projects/hello/’

/Users/Zabob_Kwon/Documents/android-ndk-r10e/build/core/ Android NDK: Module cocos2dcpp_shared depends on undefined modules: cocos_libxml2_static

/Users/Zabob_Kwon/Documents/android-ndk-r10e/build/core/ *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies) . Stop.

make: Leaving directory `/Users/Zabob_Kwon/Documents/Game/cocos2d-x-v2-master/projects/hello/’

Error running command, return code: 2.


git pull && cocos run -p android --android-studio --app-abi armeabi-v7a:arm64-v8a # -m release


you can try this generator for cocos2dx 2.2.6



Thanks you @yinjimmy I’ve listed all steps that I follow to run my project below:



I build successed again! Thanks!
So I tested my game on GooglePlay Beta test.
I got email from Google.

Hello Google Play Developer,

We rejected Infinity Dungeon VIP: RPG Adventure, with package name com.sosc.firstfantasy1super, for violating our Malicious Behavior or User Data policy. If you submitted an update, the previous version of your app is still available on Google Play.

This app uses software that contains security vulnerabilities for users or allows the collection of user data without proper disclosure.

Below is the list of issues and the corresponding APK versions that were detected in your recent submission. Please upgrade your app(s) as soon as possible and increment the version number of the upgraded APK.

Vulnerability APK Version(s) Past Due Date

The vulnerabilities were addressed in OpenSSL 1.02f/1.01r. To confirm your OpenSSL version, you can do a grep search for:

$ unzip -p YourApp.apk | strings | grep “OpenSSL”

You can find more information and next steps in this Google Help Center article.|143|July 13, 2016|

To confirm you’ve upgraded correctly, submit the updated version of your app to the Play Console and check back after five hours to make sure the warning is gone.

While these vulnerabilities may not affect every app that uses this software, it’s best to stay up to date on all security patches. Make sure to update any libraries in your app that have known security issues, even if you’re not sure the issues are relevant to your app.

Apps must also comply with the Developer Distribution Agreement and Developer Program Policies.

If you feel we have made this determination in error, please reach out to our developer support team.


The Google Play Team

I think You used Lower version OpenSSL.
I checked by Apk. I found ‘arm64-v8a’ used ‘OpenSSL 1.0.1l 15 Jan 2015’



I updated the libcurl and openssl, and tested cocos run -p android --android-studio --app-abi armeabi-v7a:arm64-v8a -m release.

$ strings cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/arm64-v8a/libssl.a | grep "OpenSSL"
OpenSSL 1.1.0c  10 Nov 2016

plz help to test.



Ok I checked OpenSSL version on my Apk.
I will update GooglePlay Beta Test.
I’ll let you know the result.




Ok Update Succeed My Game on Google Play.

via your engine. compile and build on Eclipse enviroment.

I’ll checked bug report for It is Ok.

1 Like


I added your game to the project Games. I’ll remove it if you do not want show it in the project.



No problem. I will also advertise your engine to 2.x users.
Thanks again :slight_smile:



Good to hear you can make it work and deploy successfully for android 64 bits.