AppCenter in .NET MAUI app targeting .NET 8

840 views Asked by At

I'm trying to add AppCenter Analytics and Crash reporting to my .NET MAUI app targeting .NET 8 -- using the latest versin of Visual Studio 17.8.0 and the version of .NET 8 installed on my machine is 8.0.100.

I add Microsoft.AppCenter.Analytics and Microsoft.AppCenter.Crashes packages, both version 5.0.3. They also add Microsoft.AppCenter as a dependency.

I then add the following in MauiProgram.cs right before return builder. Build(); line:

AppCenter.Configure("ios=my-secret-for-ios-from-appcenter-portal;android=my-secret-for-android-from-appcenter-portal");
if (AppCenter.Configured)
{
    AppCenter.Start(typeof(Analytics));
    AppCenter.Start(typeof(Crashes));
}

I can build the app but as soon as I start the app, it crashes on my iPhone connected to my laptop via USB.

After installing the NuGet packages, I did remove bin and obj folders. Cleaned the solution and rebuilt it. I then run it on an iPhone connected to my Windows machine via USB and it instantly crashes.

I was able to play with AppCenter on a .NET MAUI app before. Is anyone else experiencing any issues on a .NET MAUI app targeting .NET 8?

3

There are 3 answers

0
Andy Horton On

I'm having the same issues (CLang++ compile fail) and will be monitoring any package updates for the AppCenter compatibility ranges, esp. under .NET 8.0.

I see in the following forum that there are some POC elements so I'm going to check them out. Or remove AppCenter from my solution until this all gets resolved.

https://github.com/microsoft/appcenter-sdk-dotnet/issues/1755

I also updated my Visual Studio and XCode as there is now support for more recent tooling to see if this brings any improvements. https://github.com/xamarin/xamarin-macios/releases/tag/dotnet-8.0.1xx-xcode15.1-8004

0
Jay Kannan On

I simply decided to use AppCenter just for analytics and crashes and I've automated GitHub Actions to compile and deliver the apps to it using CLI. Have done this for symbols as well.

0
Bruno Garcia On

Sentry is more popular and has supported .NET MAUI from the start with line number for Android and iOS in prod builds. On iOS for NativeAOT builds, and Android for Mono JIT as well as Native AOT, so normal apps, and for iOS on newer NativeOAT which afaik is default on .NET 8.

There's no other tool that does symbolication server side as Sentry afaik. Also it bundles/binds the native SDKs so you get crashes from binding libraries not written in C#. You definitely have Java/Kotlin or Objective-C/Swift code in your app and with the same .NET builds symbols are uploaded to Sentry and you get crashes and line numbers regardless of where it comes from. Requires symbol upload