Skip to content

Xamarin.Firebase.Crashlytics.NDK packages firebase-crashlytics-ndk twice (embedded AAR + XamarinBuildDownload), causing duplicate XA4301 warnings #1538

Description

@tomcurran

Android framework version

net10.0-android

Affected platform version

.NET SDK 10.0.400, macOS 15 (Apple Silicon)

Description

Xamarin.Firebase.Crashlytics.NDK includes the Google Maven artifact com.google.firebase:firebase-crashlytics-ndk twice, which produces XA4301 duplicate-native-library warnings in every Android build that references the package:

warning XA4301: APK already contains the item lib/arm64-v8a/libcrashlytics-common.so; ignoring.
warning XA4301: APK already contains the item lib/arm64-v8a/libcrashlytics-handler.so; ignoring.
warning XA4301: APK already contains the item lib/arm64-v8a/libcrashlytics-trampoline.so; ignoring.
warning XA4301: APK already contains the item lib/arm64-v8a/libcrashlytics.so; ignoring.

(4 libraries × 4 ABIs = 16 warnings per build.)

The two copies come from the same NuGet package through two different mechanisms:

  1. The AAR embedded in the package itself: lib/net10.0-android36.0/firebase-crashlytics-ndk.aar.
  2. The same artifact downloaded again at build time by Xamarin.Build.Download: buildTransitive/net10.0-android36.0/Xamarin.Firebase.Crashlytics.NDK.targets declares a XamarinBuildDownload item for https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-crashlytics-ndk/20.0.6/firebase-crashlytics-ndk-20.0.6.aar.

Mapping evidence from obj/Debug/net10.0-android/libraryprojectimports.cache (observed with 120.0.6):

lp/239 <- ~/.nuget/packages/xamarin.firebase.crashlytics.ndk/120.0.6/lib/net10.0-android36.0/firebase-crashlytics-ndk.aar
lp/310 <- ~/Library/Caches/XamarinBuildDownload/firebasecrashlyticsndk-20.0.6/firebasecrashlyticsndk-20.0.6.aar

The targets file also registers the downloaded AAR twice (identical consecutive lines):

<ItemGroup>
  <XamarinBuildDownloadAndroidAarLibrary Include="$(XamarinBuildDownloadDir)firebasecrashlyticsndk-20.0.6\firebasecrashlyticsndk-20.0.6.aar" />
  <XamarinBuildDownloadAndroidAarLibrary Include="$(XamarinBuildDownloadDir)firebasecrashlyticsndk-20.0.6\firebasecrashlyticsndk-20.0.6.aar" />
</ItemGroup>

I verified the latest release 120.1.0 (published 2026-07-15) still both embeds lib/net10.0-android36.0/firebase-crashlytics-ndk.aar and carries the XamarinBuildDownload targets, so all currently shipping versions are affected. Xamarin.Firebase.Crashlytics has the same double-inclusion of firebase-crashlytics.aar; it just doesn't warn because that AAR carries no jni/ libraries.

This is the same defect that #1519 reported for Xamarin.Google.MLKit.BarcodeScanning, and the template fix merged in #1520 should already cover these packages — both firebase-crashlytics entries in config.json are "type": "xbd". What's missing is a re-release: could the nugetVersion for Xamarin.Firebase.Crashlytics / Xamarin.Firebase.Crashlytics.NDK be bumped so packages regenerated with the fixed templates ship to NuGet?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions