Skip to content

io.sentry.proguard-uuid error during _ManifestMerger step when building MAUI app #4597

Closed

Description

@pierre-galaup

Package

Sentry.Maui

.NET Flavor

.NET

.NET Version

9.0.305

OS

Android

OS Version

No response

Development Environment

Rider 2024 (MacOS)

SDK Version

5.16.0

Self-Hosted Sentry Version

No response

Workload Versions

From AZURE DEVOPS pipelines :

Installing workload manifest microsoft.net.sdk.android version 35.0.101...
Installing workload manifest microsoft.net.sdk.ios version 18.5.9219...
Installing workload manifest microsoft.net.sdk.maccatalyst version 18.5.9219...
Installing workload manifest microsoft.net.sdk.macos version 15.5.9219...
Installing workload manifest microsoft.net.sdk.maui version 9.0.82...
Installing workload manifest microsoft.net.sdk.tvos version 18.5.9219...

UseSentry or SentrySdk.Init call

                // The DSN is the only required setting.
                options.Dsn = Configuration.SentryDsn;

                // Use debug mode if you want to see what the SDK is doing.
                // Debug messages are written to stdout with Console.Writeline,
                // and are viewable in your IDE's debug console or with 'adb logcat', etc.
                // This option is not recommended when deploying your application.
                options.Debug = false;

#if IOS
                options.Native.EnableAppHangTracking = false;
                options.Native.EnableAppHangTrackingV2 = false;

                // Suppress native SIGSEGV Segfault errors
                options.Native.SuppressSignalAborts = false;
                options.Native.SuppressExcBadAccess = false;

                options.Native.EnableNetworkTracking = false;
                options.Native.EnableNetworkBreadcrumbs = false;
#endif

#if ANDROID
                options.Native.AnrEnabled = false;

                // Suppress native SIGSEGV Segfault errors
                options.Android.SuppressSegfaults = false;

                options.Native.EnableNetworkEventBreadcrumbs = false;
                options.Native.EnableSystemEventBreadcrumbs = false;
#endif

                // Set TracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
                // We recommend adjusting this value in production.
                options.TracesSampleRate = 1.0;

                options.MinimumEventLevel = LogLevel.None;
                options.MinimumBreadcrumbLevel = LogLevel.Trace;
                options.MaxBreadcrumbs = 100;

                // Other Sentry options can be set here.
                options.IncludeTextInBreadcrumbs = true;
                options.IncludeTitleInBreadcrumbs = true;
                options.IncludeBackgroundingStateInBreadcrumbs = true;

                options.AutoSessionTracking = true;
                options.IsGlobalModeEnabled = true;

                options.CacheDirectoryPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

                options.Environment = Configuration.Environment;
                options.SendDefaultPii = false;
                options.CaptureFailedRequests = false;

                options.ShutdownTimeout = TimeSpan.FromSeconds(1);

                options.AddCommunityToolkitIntegration();
            })

Steps to Reproduce

Hello,

After updating to 5.16.0, I can no longer build/publish in release mode. I get this error during “_ManifestMerger”:

         /Users/runner/work/1/s/Sources/XXXX/obj/Release/net9.0-android/AndroidManifest.xml:138:5-110 Error:
         	Element meta-data#io.sentry.proguard-uuid at AndroidManifest.xml:138:5-110 duplicated with element declared at AndroidManifest.xml:137:5-110
     1>MANIFESTMERGER: /Users/runner/work/1/s/Sources/XXXX/obj/Release/net9.0-android/AndroidManifest.xml error:  [/Users/runner/work/1/s/Sources/XXXX/XXXX.csproj::TargetFramework=net9.0-android]
             Validation failed, exiting

If I build without Sentry, everything works fine. I reverted to 5.15.1 and it works without any issues.

I have a MAUI project and a .net android project, and both are giving me this error after updating Sentry to 5.16.0.

I use dotnet publish to build my application with parameters :

-p:SentryOrg=XXXXX -p:SentryProject=XXXXX -p:SentryUploadSymbols=true -p:SentryUploadSources=false -p:SentryUploadAndroidProguardMapping=true

And my PropertyGroup are :

.net android project :

    <PropertyGroup Condition="'$(Configuration)'=='Release'">
        <Optimize>true</Optimize>
        <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
        <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
        <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
        <AndroidUseAapt2>true</AndroidUseAapt2>
        <AndroidEnableMultiDex>false</AndroidEnableMultiDex>
        <AndroidPackageFormat>aab</AndroidPackageFormat>
        <MtouchLink>SdkOnly</MtouchLink>
        <AndroidDexTool>d8</AndroidDexTool>
        <AndroidLinkTool>r8</AndroidLinkTool>
        <AndroidCreateProguardMappingFile>True</AndroidCreateProguardMappingFile>
        <MtouchEnableSGenConc>true</MtouchEnableSGenConc>
        <CreatePackage>false</CreatePackage>
        <AndroidStoreUncompressedFileExtensions>.mp3</AndroidStoreUncompressedFileExtensions>
        <AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
        <AndroidTlsProvider>btls</AndroidTlsProvider>
        <AndroidLinkMode>SdkOnly</AndroidLinkMode>
        <BundleAssemblies>false</BundleAssemblies>
        <RunAOTCompilation>true</RunAOTCompilation>
        <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
        <EnableLLVM>false</EnableLLVM>
        <AndroidStripILAfterAOT>true</AndroidStripILAfterAOT>

        <CopyDebugSymbolFilesFromPackages>true</CopyDebugSymbolFilesFromPackages>
        <CopyDocumentationFilesFromPackages>true</CopyDocumentationFilesFromPackages>
    </PropertyGroup>

MAUI project :

<PropertyGroup Condition="'$(Configuration)'=='Release'">
     <UseInterpreter>false</UseInterpreter>
     <MtouchDebug>False</MtouchDebug>
     <AndroidPackageFormat>aab</AndroidPackageFormat>
     <AndroidDexTool>d8</AndroidDexTool>
     <AndroidLinkTool>r8</AndroidLinkTool>
     <AndroidCreateProguardMappingFile>True</AndroidCreateProguardMappingFile>
     <AndroidUseAapt2>true</AndroidUseAapt2>
     <AndroidEnableMultiDex>false</AndroidEnableMultiDex>
     <AndroidStoreUncompressedFileExtensions>.mp3</AndroidStoreUncompressedFileExtensions>
     <UseNativeHttpHandler>true</UseNativeHttpHandler>
     <AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
     <Optimize>true</Optimize>
     <BundleAssemblies>false</BundleAssemblies>
     <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
     <MtouchLink>SdkOnly</MtouchLink>
     <MtouchEnableSGenConc>true</MtouchEnableSGenConc>
     <MtouchExtraArgs>-gcc_flags="-dead_strip"</MtouchExtraArgs>
     <CodesignEntitlements>Platforms\iOS\Entitlements.production.plist</CodesignEntitlements>
     <DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
     <CreatePackage>false</CreatePackage>
     <MtouchUseLlvm>true</MtouchUseLlvm>
     <EnableCodeSigning>true</EnableCodeSigning>
     <RunAOTCompilation>true</RunAOTCompilation>
     <AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
     <EnableLLVM>false</EnableLLVM>
     <AndroidStripILAfterAOT>true</AndroidStripILAfterAOT>

     <CopyDebugSymbolFilesFromPackages>true</CopyDebugSymbolFilesFromPackages>
     <CopyDocumentationFilesFromPackages>true</CopyDocumentationFilesFromPackages>

     <DebugSymbols>true</DebugSymbols>
     <DebugType>portable</DebugType>
 </PropertyGroup>

Is this related to #4532?

Expected Result

Build OK

Actual Result

         /Users/runner/work/1/s/Sources/XXXX/obj/Release/net9.0-android/AndroidManifest.xml:138:5-110 Error:
         	Element meta-data#io.sentry.proguard-uuid at AndroidManifest.xml:138:5-110 duplicated with element declared at AndroidManifest.xml:137:5-110
     1>MANIFESTMERGER: /Users/runner/work/1/s/Sources/XXXX/obj/Release/net9.0-android/AndroidManifest.xml error:  [/Users/runner/work/1/s/Sources/XXXX/XXXX.csproj::TargetFramework=net9.0-android]
             Validation failed, exiting

Activity

  1. added
    BugSomething isn't working
    .NETPull requests that update .net code
    on Oct 6, 2025
  2. linear commented on Oct 6, 2025

    @linear
  3. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Oct 6, 2025
  4. Flash0ver commented on Oct 6, 2025

    @Flash0ver
    Contributor

    Thank you @pierre-galaup for the report.

    It indeed seems to be related to #4532.
    Updated docs via getsentry/sentry-docs#14995

    @pierre-galaup
    Are you explicitly setting io.sentry.proguard-uuid?
    Or is the duplication caused by the combination of SentryUploadAndroidProguardMapping and AndroidCreateProguardMappingFile?

    @alexsohn1126
    Is this a scenario that we could/should guard against?
    If this is a "usage error" or "ambiguity", could/should this be a warning instead of an error?


    EIther way ... probably worth having an (updated) integration test around this scenario.

  5. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 6, 2025
  6. pierre-galaup commented on Oct 6, 2025

    @pierre-galaup
    Author

    @Flash0ver
    No, I am not setting io.sentry.proguard-uuid in my code.

    Would you like me to test something?

  7. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Oct 6, 2025
  8. 5 remaining items

  9. pierre-galaup commented on Oct 10, 2025

    @pierre-galaup
    Author

    Hello,

    I managed to reproduce it on a new project sample. It comes from “multiple” projects.

    I have a MAUI project that depends on an Android/iOS class library and a C# class library.

    I am attaching the complete project that causes this error.

    The build command:

    dotnet build --no-restore -c Release -f net9.0-android --verbosity normal -p:SentryOrg=test -p:SentryProject=test -p:SentryUploadSymbols=true -p:SentryUploadSources=false -p:SentryUploadAndroidProguardMapping=true

    The error:

        /usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.101/tools/Xamarin.Android.Common.targets(1561,3): error XAAMM0000: 
          /Users/pierre/RiderProjects/ioSentryProguardUuid/ioSentryProguardUuid/obj/Release/net9.0-android/lp/188/jl/AndroidManifest.xml Warning:
            Namespace 'com.google.android.gms.base' used in: AndroidManifest.xml, AndroidManifest.xml.
          /Users/pierre/RiderProjects/ioSentryProguardUuid/ioSentryProguardUuid/obj/Release/net9.0-android/lp/189/jl/AndroidManifest.xml Warning:
            Namespace 'com.google.android.gms.common' used in: AndroidManifest.xml, AndroidManifest.xml.
          /Users/pierre/RiderProjects/ioSentryProguardUuid/ioSentryProguardUuid/obj/Release/net9.0-android/lp/190/jl/AndroidManifest.xml Warning:
            Namespace 'com.google.android.gms.location' used in: AndroidManifest.xml, AndroidManifest.xml.
          /Users/pierre/RiderProjects/ioSentryProguardUuid/ioSentryProguardUuid/obj/Release/net9.0-android/lp/191/jl/AndroidManifest.xml Warning:
            Namespace 'com.google.android.gms.tasks' used in: AndroidManifest.xml, AndroidManifest.xml.
          /Users/pierre/RiderProjects/ioSentryProguardUuid/ioSentryProguardUuid/obj/Release/net9.0-android/AndroidManifest.xml:14:5-110 Error:
            Element meta-data#io.sentry.proguard-uuid at AndroidManifest.xml:14:5-110 duplicated with element declared at AndroidManifest.xml:13:5-110
          /Users/pierre/RiderProjects/ioSentryProguardUuid/ioSentryProguardUuid/obj/Release/net9.0-android/AndroidManifest.xml Error:
            Validation failed, exiting
    
    

    ioSentryProguardUuid.zip

  10. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Oct 10, 2025
  11. alexsohn1126 commented on Oct 10, 2025

    @alexsohn1126
    Member

    Thank you so much for the reproduction!

    I was able to recreate the issue. I think the cause was that the AndroidLib1 project would also try to generate a UUID - along with ioSentryProguardUuid project - because we have the target UpdateAndroidMetadata inside buildTransitive/Sentry.targets 😮‍💨

    So transitively, AndroidLib1 generates a UUID and adds it to the assembly attributes, so does ioSentryProguardUuid.

    This is a case I haven't thought of yet. I think moving UpdateAndroidMetadata target out of buildTransitive folder should fix this issue. I'll try that and make a PR if that works.

  12. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 10, 2025
  13. pierre-galaup commented on Oct 11, 2025

    @pierre-galaup
    Author

    It's a bit of a special case, in fact: we use it to have a common Android library between a MAUI project and a .net Android project (WearOS app).

    If you need me to do any tests on my complete project or anything else, don't hesitate to ask.

  14. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Oct 11, 2025
  15. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeBugSomething isn't workingFramework: MAUI

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions