An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Hi @nandu kathmandi ,
Thanks for reaching out.
I would recommend verifying on the Android side of your .NET MAUI (net9.0) project:
- The
google-services.jsonfile not included properly -
ApplicationVersionnot incremented - Package name mismatch
- Testing only Debug builds
- ProGuard/R8 stripping Firebase classes
- Ensure
google-services.jsonis properly configured
For Android, Firebase relies on the google-services.json file being correctly included in the project:
- Place the file under:
Platforms/Android/google-services.json - Include it in your
.csproj:
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-android'">
<GoogleServicesJson Include="Platforms\Android\google-services.json" />
</ItemGroup>
- Verify version tracking configuration
Firebase Release Monitoring depends on Android’s versionCode and versionName. In your .csproj, make sure these are set and incremented with every release:
<PropertyGroup Condition="'$(TargetFramework)' == 'net9.0-android'">
<ApplicationVersion>42</ApplicationVersion>
<ApplicationDisplayVersion>2.3.0</ApplicationDisplayVersion>
</PropertyGroup>
-
ApplicationVersion-> maps toversionCode -
ApplicationDisplayVersion-> maps toversionName
Firebase uses these values to track different versions of your app. Each time you publish a new build, these values need to change so Firebase can distinguish releases.
- Confirm Firebase initialization in
MauiProgram.cs
When using Plugin.Firebase, explicit initialization is required on Android. For example:
#if ANDROID
builder.UseFirebaseApp();
builder.UseFirebaseCrashlytics();
#endif
- Verify AndroidManifest package name
In Platforms/Android/AndroidManifest.xml, ensure your package name exactly matches:
- The package registered in Firebase Console
- The package in
google-services.json
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourcompany.yourapp">
Any mismatch will prevent Firebase from associating crash reports and releases correctly.
- Test using a signed Release build
Firebase Release Monitoring typically tracks Release builds, not Debug builds. Build and test using:
dotnet build -c Release -f net9.0-android
Or publish a signed AAB/APK. Debug builds often do not report version information correctly, which could explain missing releases in Firebase.
- Check ProGuard/R8 configuration (if using code shrinking)
If code linking or shrinking is enabled, Firebase classes might get removed. Add a Platforms/Android/proguard.cfg file:
-keep class com.google.firebase.** { *; }
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.firebase.**
-dontwarn com.google.android.gms.**
And reference it in your .csproj:
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)' == 'Release|net9.0-android'">
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<AndroidEnableProguard>true</AndroidEnableProguard>
<ProguardConfiguration>Platforms\Android\proguard.cfg</ProguardConfiguration>
</PropertyGroup>
- Package consistency
Ensure all Plugin.Firebase packages are compatible and aligned. In your case, both Plugin.Firebase and Plugin.Firebase.Crashlytics are at version 3.0.0, which is correct. For reference, the Plugin.Firebase GitHub provides platform-specific setup instructions.
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.