-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large APK Size #1097
Comments
+1 |
@yms2772 I didn't realize that. Typical Android Studio apps come out as around 500kb I think. |
Yes, it seems that there are many resources that are not used in apk. |
There are a number of things at play here. To work across all platforms we embed a lot of resources. That means the current minimym app size is about 15MB - we will, at some point, find a way to determine which resources are not needed and strip them out. Much of this is fonts which we could reduce if we find a cunning way to implement localisation (i.e. fonts downloaded and cached when needed?). Additionally on mobile there are some libraries packaged that we need to slim out as I don't think all are needed. Lastly the Android bundles build for all supported architectures by default (4) which massively inflates the build size. On the |
FYI the fonts seem to add around 8MB at the moment, whilst icons are just 100KB. |
After looking into it more the fonts seem to compress well and take up less than 1MB in the final binary, so it looks like elsewhere is where we hunt to reduce below the 15MB app mark. |
It may be a good sign that in go 1.15 there are marked improvements to binary size which we should also benefit from golang/go#6853 |
In case anyone was holdong out hope for the <1MB app size this is not going to be possible - we need to ship the Go runtime in every app so it's not going to be possible to deliver apps as slim as vanilla Android or iOS binaries as their runtimes are installed in the OS and do not have to be packaged. |
I know with wasm you can drastically reduce the binary size by avoiding the fmt library. Not sure if that works for android though |
I'm pretty sure that most apps (and indeed the toolkit) will need to use formatting of strings, so I don't know that will help us a huge amount. It is certainly worth us checking that we don't import any code that's not used - but at the end of the day there is a lot involved in showing graphical windows etc. |
I'm pretty sure you can also target the architecture in the Google play developer account. |
I meet https://github.com/cnlohr/rawdrawandroid, which can maybe be usefull to reduce binary size on android ... |
When building the simple Hello World Fyne example, the output APK size is almost 60mb (58.3 on my end).
This is very large compared to apps built with Android Studio, and is a
problem with releasing production apps in the future.
Is there any possibility of a smaller APK size?
The text was updated successfully, but these errors were encountered: