Problem with cocos2d-x 3.16 for exporting 64bit apk

My cocos2d-x version is 3.16 and I want to make 64bit apk through the Android-Studio…
I build the my project with this setting below

In Application.mk:
APP_ABI := armeabi-v7a arm64-v8a

And in gradle properties:
PROP_APP_ABI=armeabi-v7a:arm64-v8a

and the apk has lib like below

55

If i install apk to 32bit device then lunch with that and lead to crash …
but that’s fine because I thought the apk only for 64bit device…

So I try again with 64bit phone and crash also… appeared this line

static {
System.loadLibrary(“cocos2dcpp”);
}

so I wander what need this code line for 64bit phone?

and Am I right making 64bit apk?

Plus, I commented //System.loadLibrary(“cocos2dcpp”); this code, then apk work nicely on 64bit phone.

Someone tell me that reason?, help me plz !!

Where was the line System.loadLibrary(“cocos2dcpp”) from? Did you update your game from an older version of cocos2dx? I never had any libcocos2dcpp.so files within my APKs.

Thank you for your reply.
I’ll check where that come from.
So It means libMyGame.so is enough to walking on 64 bit phone?

In my project, everything is packed into one shared object (libMyGame.so). That’s why I asked, if you updated from an older version. Maybe it was different years ago.

set PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86 with proj.android/gradle.properties file.

Application.mk is for eclipse :wink:

But this doesn’t explain the second shared object file in the libs folder.

And you are not quite right. Application.mk isn’t only for Eclipse. It’s also for updated projects, where no PROP_APP_ABI is in the build.gradle and therefore you will build with ndk-build instead of cmake.

Thank you for your help @mars3142, @yinjimmy really thank you. @mars3142 yes your right The libcocos2d object is kinda trace of legacy version of cocos2dx. So I gonna tracking about that. Again Thank you so much.

1 Like

cat you produce libcocos2dcpp.so of v8a and v7a version?

No I can’t now that’s related with 2.x cocos version So I am gonna migrated 2.x to 3.x… And there are a lot of works to do. So I am worried about that.

https://github.com/c0i/cocos2d-x-v2 support android studio and arm64

1 Like

Oh Thank you, I’ll check!!