ExzileGames.AndroidCrashlyticsBridge
1.0.24
See the version list below for details.
dotnet add package ExzileGames.AndroidCrashlyticsBridge --version 1.0.24
NuGet\Install-Package ExzileGames.AndroidCrashlyticsBridge -Version 1.0.24
<PackageReference Include="ExzileGames.AndroidCrashlyticsBridge" Version="1.0.24" />
<PackageVersion Include="ExzileGames.AndroidCrashlyticsBridge" Version="1.0.24" />
<PackageReference Include="ExzileGames.AndroidCrashlyticsBridge" />
paket add ExzileGames.AndroidCrashlyticsBridge --version 1.0.24
#r "nuget: ExzileGames.AndroidCrashlyticsBridge, 1.0.24"
#:package ExzileGames.AndroidCrashlyticsBridge@1.0.24
#addin nuget:?package=ExzileGames.AndroidCrashlyticsBridge&version=1.0.24
#tool nuget:?package=ExzileGames.AndroidCrashlyticsBridge&version=1.0.24
AndroidCrashlyticsBridge
A Java bridge + C# interop library for Firebase Crashlytics on .NET Android. Records C# exceptions with proper type grouping so that Crashlytics groups crashes by exception type rather than lumping them all under "recorded exception".
Problem
When you call FirebaseCrashlytics.getInstance().recordException(throwable) from C# via the Xamarin binding, all recorded exceptions appear under the same generic bucket in the Crashlytics dashboard. There is no way to pass a meaningful type name through the raw binding, so NullReferenceException, InvalidOperationException, and every other C# exception look identical.
Solution
This library compiles a Java bridge class directly into your Android project. The Java class constructs a real Throwable subclass whose toString() returns the original C# type name. Crashlytics uses toString() for grouping, so each distinct C# exception type gets its own issue in the dashboard. The C# stack trace is also parsed and mapped to StackTraceElement objects so frames are readable in the Crashlytics UI.
APIs Exposed
| API | Methods |
|---|---|
| Exception recording | RecordException(Exception), RecordException(string, string, string) |
| Logging | Log(string) |
| User identification | SetUserId(string) |
| Custom keys | SetCustomKey (string, bool, int, float overloads) |
| Collection control | SetCollectionEnabled(bool) |
| Crash detection | DidCrashOnPreviousExecution |
Requirements
- google-services.json must be present in your Android app project and the
GoogleServicesJsonbuild action must be set. Firebase Crashlytics will not initialise without it. - Firebase is initialised automatically via
FirebaseInitProvider— no explicitFirebaseApp.InitializeAppcall is required.
Setup
1. Add project reference
<ProjectReference Include="..\AndroidCrashlyticsBridge\AndroidCrashlyticsBridge.csproj" />
2. Add google-services.json
Place your google-services.json in the Android app project root and set its build action:
<GoogleServicesJson Include="google-services.json" />
3. Initialize in your Activity
using AndroidCrashlyticsBridge.Interop;
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);
var crashlytics = new AndroidCrashlyticsBridgeImpl(this);
CrashlyticsBridgeManager.SetImplementation(crashlytics);
}
4. Use from shared code
using AndroidCrashlyticsBridge.Interop;
// Record a caught exception (grouped by type in the dashboard)
try
{
DoSomethingRisky();
}
catch (Exception ex)
{
CrashlyticsBridgeManager.RecordException(ex);
}
// Attach contextual information
CrashlyticsBridgeManager.SetUserId("player-12345");
CrashlyticsBridgeManager.SetCustomKey("level", 7);
CrashlyticsBridgeManager.SetCustomKey("scene", "MainMenu");
// Write a breadcrumb log
CrashlyticsBridgeManager.Log("Player entered the shop");
// Check if the previous session crashed
if (CrashlyticsBridgeManager.DidCrashOnPreviousExecution)
ShowCrashRecoveryDialog();
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net10.0-android36.0
- Xamarin.Firebase.Crashlytics (>= 120.0.4.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.