I have followed the instructions from here Creating an application with the embedding API and have integrated the cross walk library which works well and displays a remote website url successfully. But the .apk file size jumped to 61.8MB from 21.8MB . I have also enable proguard rules for crosswalk inside my application. Is there any way to reduce the size of apk?(at least to the Google Play 50MB limit)
Asked
Active
Viewed 2,705 times
5
-
but proguard is not touching the native binaries (.so) ... and AFAIK crosswalk use native code for it's "WebView" ... also,AFAIK, it adds binary for every possible ABI ... the choice is obvious: do not use it or make apk for each ABI or stop whining about apk size – Selvin Jul 10 '15 at 13:15
-
@Selvin if you check https://crosswalk-project.org/documentation/about/faq.html it says what you can add rules into proguard-project.txt – hariszaman Jul 10 '15 at 13:32
-
and ? do you even understand what i wrote?.... proguard will do the job only for common java's code (which should not be a problem - it's only about 1-3MB in jar) ... real problems are the native binaries (libxwalkcore.so(about 20MB(zipped)) for every ABI(~3) )... – Selvin Jul 10 '15 at 13:33
-
I understood what you said and its even mentioned on their website I was just saying you can add rules for the jar files at least. And I am not whining about anything just asking a question, you can downvote it if you think it is inappropriate – hariszaman Jul 10 '15 at 13:54
-
whoever downvoted tell a reason – hariszaman Jul 10 '15 at 14:00
-
For your information their is 4th choice that I found just now https://crosswalk-project.org/blog/crosswalk-lite-10.html which is especially linked my question. so stop being rude to others – hariszaman Jul 10 '15 at 14:06
-
you know that it will only decrease the apk size to about 40-50 MB ? (if you wana support both x86 and ARM ABI) – Selvin Jul 10 '15 at 14:13
-
Its not about I want full 40-50MB apk size reduction but if it could be lesser like 20MB then it would be great obviously. Its that Google Play store has a limit of 50MB which I want to achieve. Now give some me the reason for downvoting – hariszaman Jul 10 '15 at 14:18
-
then seriously go for special build for each ABI ... assuming that your 20MB base apk is mostly resources(images and stuff) then with lite version of crosswalk you can get circa 30MB for one ABI ... – Selvin Jul 10 '15 at 14:21
1 Answers
4
Crosswalk builds for 2 types of arch: x86 and armv7. Libraries for each of them has weight about 20M. So in sum you get ~40M.
There are 2 options to decrease final build size:
- build 2 separate apk for each arch and upload them to Google Play (it's supported)
- use Light version of Crosswalk
For the 1st option you can check my example on Github. Repository contains example of Crosswalk embedding and some build flavors to build as x86, armv7 or combined.
For the 2nd option you can check official information here.
Some data regarding sizes of Crosswalk version:
- x86: 11.1M (vs. 20.8M on Crosswalk 10.39.232.0)
- ARM: 9.63M (vs. 18M on Crosswalk 10.39.232.0)

comrade
- 4,590
- 5
- 33
- 48
-
1crosswalk lite version is outdated and didn't worked when I tried last time – hariszaman Aug 06 '15 at 12:36