Skip to content
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

Build size skyrocketed #12

Open
AntvissMedia opened this issue Jun 7, 2020 · 8 comments
Open

Build size skyrocketed #12

AntvissMedia opened this issue Jun 7, 2020 · 8 comments
Labels
needs-info Need more information to help solve this

Comments

@AntvissMedia
Copy link

My project has only about 30 png assets. I tried the library and followed the steps to set the BaseSize in the csproj file.

Removed my assets from the android project and included them all in the shared project with the right property as instructed.

Cleaned the project, deleted obj and bin folders everywhere and started a clean build.

The build took >45 mins (when a regular build wouldn't take more than 2mins) and the build size was 350mb up from the normal 27mb.

@beeradmoore
Copy link

Are you able to put these assets in a blank forms project and replicate that issue?

@Redth
Copy link
Owner

Redth commented Jun 30, 2020

Yeah need some more context here... Posting a binlog would be helpful.

@AntvissMedia
Copy link
Author

Oh God, I wrote the reply initially after @beeradmoore messaged me and it looks like I didn't press send. I have moved on to using the xamarin embedded resources so no longer have the sample to share. Happy for you to close it if no one else reported the issue.

=== Previous reply

I can confirm that using the same assets in a blank forms project (forms, ios and android) behaves the same.

Steps to replicate:

  • Create a new project (master-detail in my case)
  • build and deploy (apk is 18mb)
  • Add about 30 assets (can confirm it doesn't matter which assets, I've also tried some standard ad banner size PNGs from Google at 728x90) and set the property for each as instructed in your getting started.
  • build and deploy (apk is now 286mb)

@Redth
Copy link
Owner

Redth commented Jul 1, 2020

You mean you see the same behaviour without Resizetizer installed, in a normal forms app?

@AntvissMedia
Copy link
Author

No, without Resizetizer the apk was 18mb. After installing the nuget package and configuring the assets for Resizetizer the next build was over 200mb. No additional changes have been made to the default project apart from adding the nuget package and moving the assets from the android resources folder to the shared project and changing the properties for each.

@IvoKrugers
Copy link

IvoKrugers commented Sep 7, 2020

I've got the same problem. Build takes over 30 minutes...
Here is a sample project to reproduce the problem.

@Redth
Copy link
Owner

Redth commented Sep 16, 2020

@IvoKrugers thanks for the repro, this is helpful!

It looks like you have a fair amount of bigger images which do just take some time to process, and so resizetizer itself is taking about 10s on android to do this work.

Aapt2 on the other hand is taking 3+ minutes...

We are looking at this to see if there's anything obvious causing it!

@Redth
Copy link
Owner

Redth commented Sep 17, 2020

@IvoKrugers you are setting BaseSize="515,641" is this the actual size you are using in your code? (eg: <Image Source="Calfskin-Cover.png" WidthRequest="515" HeightRequest="641" />).

That's the first thing I'd check, BaseSize should be the size you intend to use in code.

If that is the case, the next thing I can see is Resizetizer is scaling those images up to larger sizes to produce HDPI, XHDPI, XXHDPI, XXXHDPI resolutions which is a bug and I should ignore the cases where the image is being upscaled as it doesn't really make sense to do that, we can just let the device load the largest available resolution images at runtime and not pre-scale them up.

@Redth Redth added the needs-info Need more information to help solve this label Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Need more information to help solve this
Projects
None yet
Development

No branches or pull requests

4 participants