Dotnet Maui Release build is very slow, about 25 minutes

Rafael Sacomani 0 Reputation points
2024-03-29T03:41:50.4866667+00:00

I am trying to build my app in release, but is very slow to complete...abount 25 minutes...the process freeze in the log commented bellow.

What I can do to build mor faster and improve the time?

MacOs 14 - Sonoma

<PackageReference Include="Plugin.Firebase.CloudMessaging" Version="2.0.4" />

And

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">

<PackageReference Include="Xamarin.AndroidX.Core" Version="1.12.0.3" />

<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.2" />

<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.2" />

<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.1.1" />

<GoogleServicesJson Include="google-services.json" />

<PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.2">

</PackageReference>
```  </ItemGroup>  
  
Console Log:



  Optimizing assemblies for size. This process might take a while.

/Users/saccomani/.nuget/packages/xamarin.firebase.ios.core/8.10.0.3/lib/net6.0-ios15.4/Firebase.Core.resources/GoogleUtilitiesComponents.xcframework/ios-arm64/GoogleUtilitiesComponents.framework/GoogleUtilitiesComponents : warning MT7091: The framework /Users/saccomani/.nuget/packages/xamarin.firebase.ios.core/8.10.0.3/lib/net6.0-ios15.4/Firebase.Core.resources/GoogleUtilitiesComponents.xcframework/ios-arm64/GoogleUtilitiesComponents.framework is a framework of static libraries, and will not be copied to the app. [/Users/saccomani/Documents/GitHub/GestaoEscolar/src/GE.Core/GE.Core.csproj::TargetFramework=net8.0-ios]

/Users/saccomani/Library/Caches/XamarinBuildDownload/GAppM-8.9.1/GoogleAppMeasurement-8.9.1/Frameworks/GoogleAppMeasurement.xcframework/ios-arm64_armv7/GoogleAppMeasurement.framework/GoogleAppMeasurement : warning MT7091: The framework /Users/saccomani/Library/Caches/XamarinBuildDownload/GAppM-8.9.1/GoogleAppMeasurement-8.9.1/Frameworks/GoogleAppMeasurement.xcframework/ios-arm64_armv7/GoogleAppMeasurement.framework is a framework of static libraries, and will not be copied to the app. [/Users/saccomani/Documents/GitHub/GestaoEscolar/src/GE.Core/GE.Core.csproj::TargetFramework=net8.0-ios]

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,870 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,336 Reputation points Microsoft Vendor
    2024-04-01T06:27:06.64+00:00

    Hello,

    It cannot build faster and improve the time unless you remove the packages and do not use the XCframework.

    As described in the Log: Optimizing assemblies for size. This process might take a while. It takes a long time because the size of the app is being compressed.

    You are using a firebase package and a GoogleAppMeasurement package, and the warning is from these XCFrameworks. A XCframework can contain multiple binaries and it contains universal binaries covering the architectures each platform builds for. When you release/publish the app, it will provide you with specific slices to reduce the app size.

    For more details, please refer to Creating a multiplatform binary framework bundle | Apple Developer Documentation

    Reducing your app’s size | Apple Developer Documentation

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments