How to reduce android app size

Hi

I’m new here in the community, so I’ve compiled the HelloWorld project a few days ago.
My problem is that when I built the project to android and installed in my phone, its size is about 13.5MB. I think it is too big for such a simple application. I wonder what can I do to solve this problem.
I searched here about this issue, but couldn’t find a detailed solution.

Thanks

1 Like

The functionality of HelloWorld might be very “simple” but you have to remember hidden away in the project is the entire Cocos2D-x SDK. Which is a hell of a lot of data. Personally I don’t think 13.5mb is very big at all. Considering it’s only the base and with a simple game with a few resources your only looking at maybe 3-4mb on top of that.

I also depends a lot on how many ABI you’re supporting. Each one adds another complete copy of Coco2d-x to the Android APK.

Which are the supported ABIs by default and where can you change them?

I’ve been looking for this for some time.

It’s about 13mb too in my simple project. Someone said that because it’s compiled project. If it’s not, i think it’s such a huge size for cocos2dx game. Maybe @slackmoehrle can explained about this more :smile:

It strange, you probably added something in resources folder. By default it should be like 3-4mb APK not 13.5. Or you mean when app installed on phone?

Yap, what he mean is the apk about 3-4mb, but when installed on phone the size up like 13.5mb @energyy

Hi @energyy
Could you please tell what ABIs should be supported for android and iOS devices.
Because each ABI increases the size of the overall app, it might not make sense to support all. But which ones to support?

Thanks :smile:

ABIs are related only to Andorid build we mostly using ARMEABI but maybe it is worth to put armeabi v7 support to.

What about putting x86.
As of now, I am putting armeabi, armeabi-7a and x86.
So, I just wanted to know from someone who has experience of launching on android and found out that armeabi and armeabi-7a works for all devices and x86 is not needed.
I can see that with just one of these the debug-apk size is ~3.6MB with 2 of them it’s ~6.5 and with all 3, it is ~8.5MB. (I am talking about HelloWorld Application with 3 extra graphics put by me.)

If you want to support x86 also, then my advice would be compile 1) APK with aremabi, armeabi-7a, then increase build version by 1 and compile APK with x86 only.

After that in Google Developer Console switch to advanced APK settings -> upload first armeabi build and after upload x86 build - > so you will have 2 builds live - one for aremabi other for x86 devices. In such way you will reduce size of app.

Oh, that is nice. I’ll have to explore the developer dashboard soon :smiley:
Thanks

You can see in google play for example for google some apps -> there is no version or size of app -> but writed depends on user platfrom/device -> it means there was used such scenario with advanced APK setup.

Yeah I’ve noticed that. But I used to think it’s for Multi screen resolution, example graphics are packed differently for different kind of devices(ldpi, mdpi, hdpi).

But ya armeabi, armeabi-7a and x86 also goes along. :smiley: