Cocos2dx v2.2.6 migration to Android studio

I have a Cocos2dx v2.2.6 project. When we started working on it Eclipse was The IDE for Android. after a while android studio become the official IDE. we stopped working on it for 3 years and now we wanna run it and every thing we were using is deprecated today. Is there any way to get my project working on Android studio?

I know v3.x can use the latest Android Studio, but I haven’t tried 2.2.6 since Eclipse was deprecated. I can ask the team if anyone has thoughts.

Can you upgrade to Cocos2d-x v3.x? Perhaps the effort is worth it, depending upon the size and functionality of your game?

Create new project in latest cocos2d and copy code and assets from old project. Fix issues

Unfortunately migration to latest version of Cocos2dx is impossible we’ve made a lot of changes within the framework itself across a years of development. I’m talking about a game with about 100 scenes

Oh, then maybe try following: create new project in latest coco2d and replace cocos2d folder with yours and try to get it work :slight_smile:

P.S. cocos2d 3.17.1 bu default uses CMake in android build. You probably need ndk-build. You can change it easily in gradle settings.

1 Like

I would try that first, for sure.

Follow this thread, you can achieve this.

  • v1.0 release for cocos2d-x 2.2.6
  • v1.1 release for supporting compile & debug c++ with Android Studio too.

2019.02.06 update libjpeg,libpng,libtiff,libwebp

2 Likes

Any plan to support for 64bit on Android?

Supported 64bit

file projects/hello/proj.android-studio/gradle.properties

change PROP_APP_ABI

PROP_APP_ABI=arm64-v8a

tested on Nexus 6P.

Is it possible with out Third_party Prebuilt???

For example,

cocos2dx/platform/third_party/android/prebuilt/libcurl

I check your engine.

armeabi-v7a,
x86

[arm64-v8a] doesn’t exist…

How can I use Network API?.

undefined reference to ‘cocos2d::extension::CCHttpClient::getInstance()’

My Game need Network…But your engine doesn’t seem to support the network…

Wonderful and thanks.
So, if we need to provide support both 32bit and 64bit for android, only change as following?

PROP_APP_ABI=armeabi-v7a;arm64-v8a

the readme.md:

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

PROP_APP_ABI=armeabi-v7a:arm64-v8a

Oh! I see.
I missed ‘TODO section’

Thanks :slight_smile:

v1.0-alpha release https://github.com/c0i/cocos2d-x-v2/tree/v1.0-alpha

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:

https://github.com/c0i/cocos2d-x-v2/commit/8c5f8aaa8c8db40bac633c8e5b8d8bccddbfba47 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/libcocos2dcpp.so
2019-02-13 00:39:51.493 17279-17279/? A/DEBUG: #01 pc 000000000045a8dc /data/app/com.sosc.firstfantasy1super-fNGe8esIftFk9aPstNK6RQ==/lib/arm64/libcocos2dcpp.so
2019-02-13 00:39:51.493 17279-17279/? A/DEBUG: #02 pc 0000000000067d0c /system/lib64/libc.so (__pthread_start(void*)+36)
2019-02-13 00:39:51.493 17279-17279/? A/DEBUG: #03 pc 000000000001eba4 /system/lib64/libc.so (__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).