9.5 C
New York
Tuesday, March 11, 2025

.NET MAUI: The construct is failing in iOS platform as a result of App Heart libraries


I’ve carried out AppCenter for crash analytics in my .NET MAUI utility. It’s working tremendous on the Android platform, however I’m dealing with a difficulty on the iOS platform. When I attempt to create a construct, it fails, and I’m unable to run the challenge from Visible Studio Code to the simulator.

For the implementation, I’ve added the next NuGet packages:

  • Microsoft.AppCenter.Analytics (Model="5.0.6")
  • Microsoft.AppCenter.Crashes (Model="5.0.6")

Implementation particulars:

In AppDelegate.cs file:

public override bool FinishedLaunching(UIApplication utility, NSDictionary launchOptions)
    {
        strive
        {
            AppCenter.Begin("AppSecret",
               typeof(Analytics), typeof(Crashes));
            return base.FinishedLaunching(utility, launchOptions);
        }
        catch (Exception exception)
        {
            Utility.SendCrashReport(exception);
            return false;
        }
    }

In Utility Class:

public static void SendCrashReport(Exception exception)
    {
        strive
        {
            Crashes.TrackError(exception);
        }
        catch (Exception ex)
        {
            SendCrashReport(ex);
        }
        
    }

When I attempt to construct the challenge for iOS, the construct fails with the next errors:

/usr/native/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error : clang++ exited with code 1: [/Users/Desktop/project name/project name/project name.csproj::TargetFramework=net8.0-ios]

/usr/native/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error : ld: constructing for 'iOS-simulator', however linking in object file (/Customers/Desktop/ challenge identify/challenge identify/obj/Launch/net8.0-ios/iossimulator-arm64/linker-cache/AppCenter.a[arm64][2](MSACAppCenter.o)) constructed for 'iOS' [/Users/Desktop/project name/project name/project name.csproj::TargetFramework=net8.0-ios]

/usr/native/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error : clang++: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/Desktop/project name/project name/project name.csproj::TargetFramework=net8.0-ios]

Moreover, when I attempt to run the challenge on the iOS simulator, it launches however solely shows a clean display screen.

Screenshot:

enter image description here

I discovered an identical subject reported on GitHub.

How can I resolve the construct failure on iOS?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles