-
Notifications
You must be signed in to change notification settings - Fork 533
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
Building a Maui App for Android is extremely slow when EmbedAssembliesIntoApk is enabled (net9) #9455
Comments
Can you create a Run the command line again with |
Why do you have EmbedAssembliesIntoApk enabled? The feature called “fast deployment” is disabled by this setting. |
We have a test server which builds apk's, and then run it with our own script on emulators and real phones. But even using locally, our team prefer building with the EmbedAssembliesIntoApk option enabled, because it works more reliable. We noticed some optimizations in the build process based on the resultant APK file size compared to net8. However, we would like to be able to disable these optimizations in Debug mode to get a faster build like it was in net8.
net8: https://github.com/AlexanderEgorov/dotnet-android--9455/blob/main/MauiBlankApp_net8/msbuild.binlog |
Hi @jonathanpeppers ! I'm a developer of the .NET Meteor extension for VSCode. I also use this property for the debugging Android applications: I tried to support the I also want the build and launch processes to be the same, both for iOS or Maccatalyst or Windows, and for Android. |
In what way is the FastDev features "unstable" ? It would be helpful to have more information as to why ? Turning FastDev off is always going to be slower because we have to not only build the apk from scratch, we also have to uninstall the app on the device before sending over the new one. All of this adds up. |
As @AlexanderEgorov said, we don't use the
It works ~40% cases, but more often it doesn't. In the .NET Meteor extension I use the manual way:
This method has been working for more than two years on all operating systems (Linux, MacOS, Windows) and for every platform (Maccatalyst, iOS, Windows, Android). |
@JaneySprings we'd prefer if you could share a We'd prefer to fix that feature than improve a sub-optimal settings that fewer developers are using by default. Most of our developers just use the defaults (all settings just blank) inside Visual Studio. |
For context on the reported issue, it appears to be a result of the "all managed assemblies are arch-specific" change. In .NET 8, we would add (N assemblies + .pdbs) to the APK as "assets". In .NET 9, for each of (N assemblies + .pdbs) x (supported ABIs), we:
We probably can't avoid the doubling of the involved files due to defaulting to 2 architectures. Users could use Aside from that, it would be ideal if we could find a managed way of doing the There is also work to be done to make the |
Description
Building a MAUI project targeting net9.0-android is much slower when EmbedAssembliesIntoApk is enabled compared to building under net8.0-android (500s in net9 vs 90s in net8). Most of the time is spent on the _BuildApkEmbed process.
Steps to Reproduce
dotnet new maui -n MauiBlankApp
targeting net9.dotnet build MauiBlankApp.csproj -p:Configuration=Debug -p:TargetFramework=net9.0-android -p:EmbedAssembliesIntoApk=true -p:AndroidSdkDirectory=...
Link to public reproduction project repository
No response
Version with bug
9.0.0-rc.2.24503.2
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.92 SR9.2
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: