Hello everyone,
I'm running into a snag while trying to generate an APK for my app. Currently, the APK's size stands at a hefty 100MB, which is far larger than I'd like it to be.
In an effort to address this, I adjusted the <EmbedAssembliesIntoApk> setting to False in my project file. However, this modification led to a failed publish process.
Visual Studio 2022 has highlighted that Fast Deployments are enabled for my app, indicating a potential conflict with the changes I've made.
Could someone offer guidance or assistance in resolving this issue? I'm open to any suggestions or insights. Thanks in advance for your help!
Hi Felipe,
Here are some suggestions to reduce the size of your APK:
Regards,
Brundha V
Hello! Brundha
I'm working with VS2022 and I'm really having trouble because I can't find any option to reduce the size.
For example, I put false in the option to not reference all assemblies, the size is 17 MB.
I don't understand why it's so difficult.
Could you give me more information and give me, for example, a video or tutorial that I can follow?
Sincerely
Felipe
Hi Felipe Sotelo,
We have investigated your query on " I can't find any option to reduce the size of the Application". We suggest you disable the AOT [Ahead-Of-Time] compilation in your project, which will help you reduce the size of your generated APK. Please refer to the attached video for more details on how to disable the AOT compilation in your project.
Please let us know whether our suggestion meets your requirements. Please do not hesitate to contact us if you have any concerns or queries.
Regards,
Prithis I.
Hi Prithis Iyyappan,I reviewed your suggestion and realized that I hadn't checked the AOT configuration.I tried a method, but encountered a problem.I use Firebase libraries for login in my app.When I set Publish Trimmed with the Link configuration, the APK size reduces from 100MB to 70MB.However, the Firebase libraries stop working correctly, and some documents mention that Firebase cannot be trimmed.So, I tried separating the login module and removing the Firebase libraries from the root app. Then, I added a new class library and set the property IsTrimmable to False in the config file.Unfortunately, this didn't work. I'm not sure what else I can do.
Hi Felipe Sotelo,
Since the issue you are facing is with Firebase libraries, Can you please try raising a query in the public forums or .NET MAUI discussion community that we have shared below.
MAUI Discussions link: https://github.com/dotnet/maui/discussions
Regards,
Prithis I.