-
Notifications
You must be signed in to change notification settings - Fork 538
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
App size is too large in Release mode with several native binded libraries #8530
Comments
Have you actually tried uploading your application to Google Play? My guess is you are actually creating an For example, with
All four of them will be in the |
Another way to estimate what the size would be on Google Play, is to build for a single architecture with
Is there also a lot of Java/Kotlin code? One difference in Android Studio is they use r8 by default, while we don't do that yet. You can opt into this by setting |
Thanks a lot for your responses, and sorry for my late answer. I have had to fix a lot of issues with my AAB to be able to submit it to PlayStore.. I've built the project with the following command line I've switched on the R8 code shrinker and the result apk is now 328MB (400MB without R8 option). Now I've built the AAB with the following command line The AAB is now 253MB (264MB without R8 option). I've tryied to upload this 253MB AAB file to the PlayStore but it told me the app was containing Debugs stuff. By setting false, the AAB was 232MB, and accepted to upload to the PlayStore. In the PlayStore Console, in the App Bunble Explorer, I open the uploaded aab and navigate to Download tab. But still the native Java/Kotlin app is 95MB with the same libraries, and much more source code lines (90k vs 65k with MAUI). |
If you want us to investigate the size of your app, can you share it? You could also list the contents of the C# vs Java/Kolin app with a tool like 7-zip ( |
Oh you also mentioned your app is a MAUI application. How does the size compare if it is a plain .NET 8 Android app? That is closer to a Java/Kotlin project. MAUI is not currently trimmable and it contributes to app size quite a bit: |
I created a new Android Application .Net 7 and add reference to the 4 binded libraries. The archive apk size is 96MB. I would be happy to share the app with you and work together to understand and find how to enhance the app size with native binded libraries. Can we use a private channel like Microsoft Support to share files ? In all cases thank you for your time ! I tried to use apkdiff between the nativ Java app and the MAUI app. Here is the summary
And here is a selection of the heaviest libraries of the two apk. I have not copied full logs.
MAUI app
|
For the second The number of Are you able to share the |
Thank you for your answer and your analyze. |
Android application type
.NET Android (net7.0-android, etc.)
Affected platform version
VSMac 17.6.3 (build 421)
Description
I am rewritting a native Android and iOS application into a single MAUI application.
This application uses 4 main native libraries, that I have binded successfully.
Those native libraries has many dependancies, sush as com.vonage:webrtc which is a 200MB aar for instance.
For iOS, the final Release ipa is 210Mb, versus 50MB with the one built in native with Swift and xCode.
For Android, the final Release apk is 400MB, versus 90MB with the one build in native with Java and Android Studio.
In Debug, apk size is 49MB... And the limit to publish an app to the Play Store is 200MB.
How can I reduce the size please ? Is it an issue with binded library ?
I really need to go under 200MB, else it is a show stopper :x After months of binding, I cannot believe it.
I've tried to follow those advices https://devblogs.microsoft.com/dotnet/dotnet-7-performance-improvements-in-dotnet-maui
Steps to Reproduce
Use the following repo to compare build size
https://github.com/espritm/MAUI.Binding_Libraries_App_Size_Perfs
It is a sample MAUI app with a dependency to one of the 4 main library I have binded (ESignature).
Building the app without the dependency gives a 9MB apk.
Building the app with the dependency in Debug gives a 28MB.
Building the app with the dependency in Release gives a 84MB.
Did you find any workaround?
No, I cannot publish to the store because of the apk size.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: