-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
8.0.92 make app size bigger #25750
Comments
In Maui 8.0.90 was merged this about Resizetizer #23924 |
Ah I miss that. So now it become more high quality which is contributing to our app size. Which is not mentioned in release notes. Thank you @bronteq . So for now for us we can just accept the increasing file size right? |
I understand that the fix done in #23924 is important. But to my point of view, this should be configurable while keeping |
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
|
#25686 fixes this, because it enables us to set |
I had a look at this and the PR may help, but I think the cause for the underlying issue is more something that you probably should avoid. Currently, you are including a 800x800 image and then asking that to be included with the rest of the image processing - including the upscaling. The base size of 400x400 is for the lowest supported density (mdpi) and this means that it is being upscaled for all the densities (hdpi, xhdpi, xxhdpi and xxxhdpi) For non-vector images (such as jpg or png) you should not be resizing but instead be marking it as "copy only" by setting an attribute on the element: <MauiImage Include="Resources\Images\electronics.png" BaseSize="400,400" Resize="false" />
Sometimes you do have a large png that you will be downscaling with a very small base size - for app icons or tab icons. This is typically the most common case and so it is the default to resize. In your case, you have 4 very large images that get upscaled to 1600x1600 and about 1.3MB and with the higher res it is about 2.8MB. If you mark as a copy, they are the original size of about 1MB. The total apk size is reduced from 52MB to 41MB. A saving of 11MB. I will review the PR independently of this issue as I think the PR may add value, however lower quality images after upscaling is probably the worse of letting the device hardware upscale if it needs to. |
@mattleibow The resizetizer does a great job. Perhaps it could output a warning when developers use too big dimensions for the source image. |
Description
We are updating our app from 8.0.82 to 8.0.92 and have increased file size to 40MB for the
.apk
. This is really unexpected because that is too much jump. 5MB might be quite reasonable but we didn't expect it to increase 40MB. After we check what is inside that increased and compared the size we found the issue is our res folder is much bigger. Is there any changes from how resizetizer work? The right is from 8.0.92 and the left one is from 8.0.82.We then tried also to reproduce with another MAUI sample app and found with smaller app we found increase app size on 5MB. With big app like us, then it is hit us with 40MB app size increase on Android
iOS app also increased around 10MB and after we check the inside it is caused because of the resources size in our folder increased as well
Steps to Reproduce
dotnet build -c Release
dotnet build -c Release
Link to public reproduction project repository
https://github.com/albilaga/MAUI-store-app
Version with bug
8.0.92 SR9.2
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.82 SR8.2
Affected platforms
iOS, Android
Affected platform versions
Android 11 and up. iOS 15 and up
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: