xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

[Issue] XF 5.0.0.2612 : sufficiently increased size of release .apk files #15832

Closed makeman-p81 closed 7 months ago

makeman-p81 commented 8 months ago

Description

Sufficiently increased size of a release .apk file for a blank Android app

5.0.0.2578 ~ 13.6 Mb 5.0.0.2612 ~ 15.8 Mb

+2.2 Mb or about +16%

Steps to Reproduce

  1. create a blank app
  2. set minimum Android API level to 21 (possible, this step is not necessary)
  3. build the app in Release mode with Xamarin Forms 5.0.0.2612 and 5.0.0.2578 then compare size of resulting .apk files

Expected Behavior

Size of .apk files closely similar

Actual Behavior

Since version 5.0.0.2612 size sufficiently increased

MitchBomcanhao commented 8 months ago

I tried the same ("blank" xamarin forms android project, target is 33, minimum is 21) and got this

image

note that from my experience the size of the classes.dex file changes considerably over time, even when the code has barely changed

junedmmn commented 8 months ago

This is a serious issue, whenever we try to upgrade Xamarin.Forms package, the build size increases significantly. Xamarin.Forms isn't even getting major updates or features, and the build size increases, this causes us to work on older versions of Xamarin.Forms. Tell us there are significant changes, updates, features and fixes in latest versions of XF, and we would consider upgrading. But still, this must be fixed, the Xamarin.Forms hasn't increased performance on mobile, even in the new versions. As controls and elements increases on a page, the page lags very much, FPS drops significantly. Even basic elements like Frame, Image make the page heavy to load and scroll.

makeman-p81 commented 8 months ago

@MitchBomcanhao

note that from my experience the size of the classes.dex file changes considerably over time, even when the code has barely changed

There is the bus schedule app [source code] based on XF. For a long time, it had stable package size, but since the recent update XF 5.0.0.2612 it had sufficiently increased. Also, this increase constantly reproduceble with "blank" app template. Seems that something did broke during build process...

image

jfversluis commented 7 months ago

I don't think there is much we can do here, we changed the default target to Android 13 and that possibly brought in bigger/more libraries? If there is anything to do then that is probably on the Xamarin.Android side of the binding libraries.

makeman-p81 commented 7 months ago

@jfversluis Possible, that it is on the binding libraries side, but this issue prevent me from upgrade to newer versions of XF, because package size is value for apps which should be tiny.