dotnet / dotnet/android

App size is too large in Release mode with several native binded libraries

Open
#8,530 8 comments 0 reactions 2 assignees Assigned to @dellis1972 View on GitHub
Area: App+Library Build need-attention
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 20h
Merged PRs (30d)
257

Description

### 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_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.