AppCenter in .NET MAUI app targeting .NET 8
Asked Answered
W

3

6

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?

Waterproof answered 17/11, 2023 at 7:32 Comment(1)
Looks like this maybe due to XCode support issues github.com/microsoft/appcenter/issues/2597Waterproof
C
0

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

Charissa answered 18/1 at 11:3 Comment(0)
D
0

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.

Drawshave answered 30/1 at 11:23 Comment(0)
W
0

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

Water answered 23/2 at 3:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.